AW: Not all values are saved

From: Tobias Marx (tobias.mar..ivecast.com)
Date: Wed May 30 2007 - 11:13:42 EDT

  • Next message: Tobias Marx: "AW: Not all values are saved"

    Thanks!

    The mappings are included (see below) - and there is only the generated
    Class as well as the Cayenne XML file - both contain the new attributes.

    The flow of events in secondary - as there is an object that contains
    certain values....and when the object is saved some are not saved.

    At first glance it really sounds like those attributes were missing -
    but they are included.....

    -----Ursprüngliche Nachricht-----
    Von: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Gesendet: Mittwoch, 30. Mai 2007 17:05
    An: use..ayenne.apache.org
    Betreff: Re: Not all values are saved

     From your description the flow of events is not quiet clear, but my
    guess is that you haven't defined the mapping for the corresponding
    "obj-attribute"'s - hasIndex, hasWkn, wknisin. One way to do it is
    to select the "Clip" ObjEntity and click on the "Sync ObjEntity with
    DbEntity" button (a button with back and forward arrows).

    Andrus

    On May 30, 2007, at 5:42 PM, Tobias Marx wrote:

    > Hi there!
    >
    > I am having some problems trying to save an object using Cayenne's
    > CayenneDataObject.class
    >
    >
    > I have added 3 new attributes to an already-existing object, but those
    > values are not stored.
    >
    > Inside the XML file these additional lines are:
    >
    > <db-attribute name="has_index" type="BOOLEAN"/>
    > <db-attribute name="has_wkn" type="BOOLEAN"/>
    > <db-attribute name="wknisin" type="VARCHAR" length="15"/>
    >
    > Inside the _Clip.java class the methods are:
    >
    > public void setHasIndex(Boolean hasIndex) {
    > writeProperty("hasIndex", hasIndex);
    > }
    >
    > public Boolean getHasIndex() {
    > return (Boolean)readProperty("hasIndex");
    > }
    >
    >
    > public void setHasWkn(Boolean hasWkn) {
    > writeProperty("hasWkn", hasWkn);
    > }
    >
    > public Boolean getHasWkn() {
    > return (Boolean)readProperty("hasWkn");
    > }
    >
    >
    > The code that saves the new data is:
    >
    > getClip().saveObject(context);
    >
    > If I add another lines for debug purposes:
    >
    > Clip temp = getClip();
    > getClip().saveObject(context);
    >
    > temp contains true, true and "something".
    >
    > However, the line that is stored in the database table
    > Contains null, null, null for those 3 Attributes.
    >
    > Any ideas?
    >
    > Thanks!
    >
    > Tobias
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed May 30 2007 - 11:14:48 EDT