Basic(fetch=LAZY) [message #1695533] |
Fri, 15 May 2015 19:26 |
Tercio F. Gaudencio Filho Messages: 4 Registered: March 2015 |
Junior Member |
|
|
Hi!
I'm having some problems with String fields lazy loaded.
Consider I have this:
@Entity
@Table(name = "Cliente")
public class EntityName {
...
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name = "fieldName")
public String getFieldName() {
return this.fieldName;
}
...
}
If I fetch this object from the database and starting changing it, just after I call setFieldName("someValue"), all previous changes I made to the object will be replaced by the values in the database.
As long I can tell, it's because it's marked as Lazy, and EclipseLink will re-fetch all fields, not only this one, and the object is replaced by the new one with the lazy field populated.
The issue seems to happen in FetchGroup onUnfetchedAttribute method.
It fetches the object itself, not only the field.
Is this the normal behavior?
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.03789 seconds