Register / Login
Win a copy of
The Little Book of Impediments (e-book only)
this week in the
Agile and Other Processes
Object Relational Mapping
Populate an empty object if none is found
posted 8 years ago
I have a many-to-one relation in my mapping file.
In some cases, this many-to-one value does not exist in the joing table.
Is it possible for me to populate this many-to-one object with only the identifier value and the rest empty?
The database does not have foreign keys so there is possible there could exist such a key that does not refer to a value in the many-to-one table.
I could add not-found="ignore", but that would entail that the mapped object gets a null object for the many-to-one relation.
In other words get Hibernate to populate/create object2 inside object1 with only the identifier value in object1.
[ February 07, 2008: Message edited by: Sverre Moe ]
constructor - help needed
Container Managed Relations
Serialization of strings
Hibernate - Mapping foreign keys tables
ManyToMany with extra attribute in JPA