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: How to set default value for a field?
PostPosted: Sat Feb 06, 2010 4:11 pm 
Newbie

Joined: Wed Jan 06, 2010 9:09 pm
Posts: 14
Hi All,

I have two objects in a many to many reln.ship via a join table. I have to work with an existing schema. The join table has a couple of extra fields in it, not just the two id fields.

I set up the many-to-many hibernate mappings as has worked elsewhere in the code for me, but when I go to save I get an exception because the extra fields in the join table don't have a default value:

Caused by: java.sql.BatchUpdateException: Field 'position' doesn't have a default value

My other example has a simple join table with just two ids, and it works fine.

How do I solve this?

Thanks,
Fred


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.