Problem using a Converter to convert to list [message #647720] |
Fri, 07 January 2011 22:33  |
Eclipse User |
|
|
|
I have a list in an object as such:
@Converter(name="rowConverter", converterClass=RowJsonSerializedObjectConverter.class)
@Convert("rowConverter")
private List<Row> rows;
When I attempt to save an instance of this class, it always has at least 1 Row. however when convertObjectValueToDataValue is called on my Converter impl, rows always has 0 rows. As far as I can tell, the last time I see the instance with the correct number of rows is this line code, in UnitOfWorkImp (line793 in r8635)
Object objectFromCache = getIdentityMapAccessorInstance().getFromIdentityMap(primaryKey, object.getClass(), descriptor);
where the local variable object has the correct number.
The object that is cloned and the object that is passed to convertObjectValueToDataValue always has an empty list of rows.
Anyone have any idea what's going on? How can I debug this further?
[Updated on: Fri, 07 January 2011 22:41] by Moderator
|
|
|
Re: Problem using a Converter to convert to list [message #647984 is a reply to message #647720] |
Mon, 10 January 2011 12:04  |
Eclipse User |
|
|
|
In what context is convertObjectValueToDataValue being called with 0 rows?
You say it is 1 for persist, so persist is working? What is not working, reading, refresh?
I would add an @Basic to the field, just to ensure it is being mapped as the correct mapping type, as List normally defaults to OneToMany.
On clone convertObjectValueToDataValue would be called with the shared cache object's value, which you seem to indicate is correct. Perhaps dump the stack trace in your convertObjectValueToDataValue to see where it is called from. Also print the value after the persist, and using a read-only query.
What EclipseLink version are you using, have you tried the latest release?
|
|
|
Powered by
FUDForum. Page generated in 0.02398 seconds