-->
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 can I remove columns whith default values from query...
PostPosted: Sun Feb 19, 2006 3:30 pm 
Beginner
Beginner

Joined: Sun Oct 16, 2005 12:37 pm
Posts: 47
Location: Romania, Galati
I have a lot of columns, in one table, with default values (but nullable columns). Is there a way to set all these default values to corespondent properties before save persistent object... or a way to reduce insert command generated by hibernate so it not include columns with default values (only those I didn't set with setter).

There are a lot of work to set properties to their default, and if I don't do that I find NULL in database (and isn't acceptable).

Need help, thx.

Hibernate version:3.0.5

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:Mysql-4.1.7; JConnector-3.0.14-Production

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 19, 2006 3:35 pm 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
Try to add dynamic-insert="true" at class level.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 19, 2006 3:51 pm 
Beginner
Beginner

Joined: Sun Oct 16, 2005 12:37 pm
Posts: 47
Location: Romania, Galati
Thx a lot the-gtm. It works fine now.


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.