My old system has some bad data.For example:
Contact table
+----+------------------+---------+---------+
| ID | EmailAddress | Name | User_ID |
+----+------------------+---------+---------+
| 1 |
nobody6@here.com | nobody6 | Joe |
+----+------------------+---------+---------+
User table
+----------+--------------+------------+----------+-------------+
| LogonID | EmailAddress | LastLogon | Password | Name |
+----------+--------------+------------+----------+-------------+
| joe_cool |
joe@cool.com | 2003-09-29 | abc1211 | Joseph Cool |
+----------+--------------+------------+----------+-------------+
User-Contact is one-to-many relation
I had saved a user object which User_ID(LogonID) is Joe and its Contact.
However,Sometime I deleted the User Joe and let its Contact Leaved.So Joe's Contact is orphon.When I try to query:
"FROM Contact contact"
Exception raised:
No row with the given identifier exists: Joe, of class: com.pegasus.messageboard.test.User
I want to avoid it that System can retrive null object (User) when it
found the related data was wrong.
Can I do it with Config file or somthing else?