cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Not all values are saved
Date Wed, 30 May 2007 15:05:04 GMT
 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
> 		
> 		
>
>
>
>
>
>
>
>


Mime
View raw message