Hi,
I am working with legacy database. When one object is referencing other, i.e. in @ManyToOne relation, value -1 means that reference to other object is NULL (by default Hibernate is expecting NULL).
Obviously when I try to load such object using Hibernate I am getting error that object with id -1 does not exist. also, when I save such object using hibernate there will be NULL value and legacy system is expecting -1.
What is the best way to make such a database to work with Hibernate?
Ideally I would like Hibernate to treat -1 as NULL on reads and writes i.e. when saving object I would like Hibernate to put -1 when reference to other object is null.
_________________ Jaroslaw
|