You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Tobias Marx <to...@fivecast.com> on 2007/05/30 16:42:44 UTC

Not all values are saved

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
		
		

    






AW: Not all values are saved

Posted by Tobias Marx <to...@fivecast.com>.
Ok...problem solved. It really was a synchronization issue - although
the mapping files looked ok before.

-----Ursprüngliche Nachricht-----
Von: Tobias Marx [mailto:tobias.marx@fivecast.com] 
Gesendet: Mittwoch, 30. Mai 2007 17:14
An: user@cayenne.apache.org
Betreff: 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:andrus@objectstyle.org] 
Gesendet: Mittwoch, 30. Mai 2007 17:05
An: user@cayenne.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
> 		
> 		
>
>
>
>
>
>
>
>






AW: Not all values are saved

Posted by Tobias Marx <to...@fivecast.com>.
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:andrus@objectstyle.org] 
Gesendet: Mittwoch, 30. Mai 2007 17:05
An: user@cayenne.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
> 		
> 		
>
>
>
>
>
>
>
>




Re: Not all values are saved

Posted by Andrus Adamchik <an...@objectstyle.org>.
 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
> 		
> 		
>
>
>
>
>
>
>
>