@PostLoad method not called when loading @ReadOnly entity from database

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

@PostLoad method not called when loading @ReadOnly entity from database

electr0 duck49
I have an entity that is meant to be immutable which wraps an XML LOB column in the table which contains additional data. Instead of modeling that additional data as explicit columns in the table, I want to process the XML after the entity is loaded via @PostLoad lifecycle listener and expose this additional data through methods of the read-only entity class.

If this entity is annotated @ReadOnly, then the post load listener is not called. I realize that many other lifecycle listener methods probably don't make sense on a read only entity, but it sure seems like @PostLoad should work. If I remove the read-only annotation, the post load listener works just fine.

I noticed that another user ran into this and filed a bug:

Are entity lifecycle listeners ever called on a @ReadOnly entity, or does that just not make sense for some broad reason?

Is is possible to make @PostLoad work in this situation? If so, could someone please point me to roughly where in the source I could try writing a patch to enable this?


eclipselink-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit