Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Basic(fetch=LAZY)
Basic(fetch=LAZY) [message #1695533] Fri, 15 May 2015 19:26
Tercio F. Gaudencio Filho is currently offline Tercio F. Gaudencio FilhoFriend
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.
Previous Topic:ConcurrentModificationException prior to updating entity.
Next Topic:Exception [EclipseLink-4002] - ORA-25156: old style outer join (+) cannot be used with ANSI joins
Goto Forum:
  


Current Time: Sat Jul 27 15:46:30 GMT 2024

Powered by FUDForum. Page generated in 0.03119 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top