Uploaded image for project: 'Click'
  1. Click
  2. CLK-63

CayenneForm getDataObject might create new data object on each call

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      Issue was mentioned here :

      http://article.gmane.org/gmane.comp.web.click.user/114

      To recap : each call to getDataObject would create and register a new data object instance, if that object is not persisted in the database.
      For already persisted object there is no problem.

      What I would like todo is the following :

      Department dep = (Department) cayenneForm.getDataObject(); //<--this call creates and registes new data object
      dep.setPerson(person);

      //because saveChanges() also makes a call to getDataObject(), another department is created and registered with cayenne,
      //and we end up with two database entries.
      cayenneForm.saveChanges();

      Kind Regards,

      bob

      Attachments

        Activity

          People

            medgar Malcolm Edgar
            sabob Bob Schellink
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: