I am trying to implement hibernate on a legacy database (that still has a legacy PHP client), and am running into some problems because the people who wrote the original app had no idea what they were doing.
The database is set up so that none of the columns are nullable, so they default foreign keys to 0 if there is no record for them. Additionally, they don't have proper foreign keys on the tables so there are a few with invalid IDs. I do not have an option to change the schema or null the appropriate columns.
This is the error I get from hibernate:
Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.tv.platform.domain.Program#0]
What I would like is a graceful way to deal with this muck, where the field will just null if the row is invalid or doesn't exist, but I am not having any luck finding how to handle this in the documenation.
Any tips?
not-found1
(ex:<many-to-one ... not-found="ignore" />
) – Sou