-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to deal with bad data
PostPosted: Mon Sep 29, 2003 1:32 am 
Newbie

Joined: Mon Sep 29, 2003 1:08 am
Posts: 1
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?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2003 5:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Why not just fix the data? Its easy.

(The only way to make Hibernate handle this w/o an exception is to create a UserType.)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 29, 2003 5:57 pm 
Newbie

Joined: Tue Oct 28, 2003 4:43 pm
Posts: 13
JIRA issue
http://opensource.atlassian.com/project ... key=HB-434


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.