This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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

Win a copy of Building Microservices this week in the Design forum!
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: transient fields and entityManager.refresh
It's not a secret anymore!