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.  [ 4 posts ] 
Author Message
 Post subject: Workaround the not-null="true"
PostPosted: Wed Sep 03, 2008 12:14 pm 
Newbie

Joined: Fri Dec 15, 2006 11:44 am
Posts: 8
In my web site, users have to sign in to submit items: the logical Hibernate mapping from the many-to-one mapping side , I am using is :

<many-to-one
column="job_submitter_company_key" not-null="true"
/>

Now, I am thinking to let users submit items without registration, do I still have to create anonymous company, or is there any workaround removing the not-null="true"

Thanks

_________________
[url=http://www.skillipedia.com]
Skillipedia: More than recruitment[/url]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2008 2:27 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
If you can manually issue an SQL statment similar to the MySQL example below it should be safe to remove the not-null attribute.

Code:
ALTER TABLE tbl MODIFY job_submitter_company INT NULL;


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 1:45 am 
Newbie

Joined: Fri Dec 15, 2006 11:44 am
Posts: 8
Do i have to use different hibernate session in this case and different mapping with no relationships?

_________________
[url=http://www.skillipedia.com]
Skillipedia: More than recruitment[/url]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2008 2:00 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Quote:
Do i have to use different hibernate session in this case and different mapping with no relationships?


I'm sorry but I don't understand what this has to do with the NULL vs. NOT NULL problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.