Hibernate entities: columns without entity properties
Posted
by lewap
on Stack Overflow
See other posts from Stack Overflow
or by lewap
Published on 2010-05-05T15:48:24Z
Indexed on
2010/05/05
16:38 UTC
Read the original article
Hit count: 225
Is there a way to "magically" persist a column which is not represented as a property in an entity? Concretely I want to add audit info to an entity without having the audit info on the entity. The audit values are not stored in the entity, but are retrieved from the environment at the time of persisting the entity. This happens in a AuditInfoUserType. The nullSafeSet gets the info from the SecurityContext, instead of reading from the entity.
In the hibernate mapping, however, the audit info properties have to be defined.
Is there a way in hibernate to define columns without properties?
© Stack Overflow or respective owner