Suppose I have an object Userlike this:
class User {
private String login;
transient private String hashedPassword;
}
I don’t want to ever pass on to hashedPasswordclients, so I am doing this in transition.
This class is displayed by Hibernate, both fields being displayed in hbm.xml.
Is this implementation safe and correct? Will Hibernate correctly store hashedPasswordin the database, load it into objects from the database, store it in the replicated second-level cache and local session cache, etc.?
In word order, transientdoes Hibernate or Level 2 caching respect in any way or completely ignore it?
EDIT . I already have two answers that don't seem to include one specific aspect of the equation. I don't use annotations at all, just XML mappings in hbm.xml. And this Java transient field is OR-mapped to hbm.xml.
source
share