|Problem reading binary data to byte array [message #1723571]
||Tue, 16 February 2016 15:50
| Antonio Raposo
Registered: February 2016
I am having some trouble reading binary data from a table to a byte array. I am using an h2 database where the field is of type LONGVARBINARY and mapping the database with annotations in my classes.|
The strange behaviour occurs when I use @Access(AccessType.PROPERTY) but when I use @Access(AccessType.FIELD) everything works as expected, ie, I can get and store the data in the database.
Using @Access(AccessType.PROPERTY) and annotating the getter with @Column I detected that the setter is called three times, The first time with the data and the next two times with null. All other fields (String and int) are also called three times but with the correct values.
I depreend the persistence is creating three objects, but the object it returns to my application has it's data field set to null.
Has anyone else experienced this? Is this a bug? Is there any workarround?
Powered by FUDForum
. Page generated in 0.01803 seconds