File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes transient fields and entityManager.refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "transient fields and entityManager.refresh" Watch "transient fields and entityManager.refresh" New topic

transient fields and entityManager.refresh

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580

I have a entity and within this entity I have transient fields. (@Transient).

When I use entityManager.refresh(entity) or Hibernate.initialize(entity), does it also override the transient fields, or are there kept?

I do not want, that the values of transient fields are set to null after a refresh. Is that the case?
I agree. Here's the link:
subject: transient fields and entityManager.refresh
It's not a secret anymore!