-->
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.  [ 1 post ] 
Author Message
 Post subject: ManyToOne - Mapping problem (Old DB)
PostPosted: Wed Oct 21, 2009 2:43 am 
Newbie

Joined: Wed Oct 21, 2009 2:31 am
Posts: 7
Hello together,

I have a problem with the @ManyToOne mapping. I get this exception:
No row with the given identifier exists: [hibernate.data.OperatorDB#0]

I have to say that bevor of using Java and Hibernate there was a C-ODBC solution, that could not handle null fields in the DB, so they decided to make all Fields 'not null' and wrote a 0 instead in to the DB.

Now Hibernate tries to solve a connection where there is no connection. Is there any posibility to tell Hibernate, if it's solving the @ManyToOne connection, it should replace or ignore connections with 0's in it?

Same problem if i'd like to add a new row with no connection. Because Hibernate tries to insert null, where the DB want's to have a not null field. (This Problem i could solve with a Reference-Object with the ID=0 so it wouldn't be a real problem, it's only a bit ugly)

At the moment we can't change the DB-Schema.

Hopefully there is an easy solution

Sorry for my bad english


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

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.