-->
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: db default value
PostPosted: Wed Nov 10, 2010 12:01 pm 
Newbie

Joined: Mon Sep 14, 2009 5:27 am
Posts: 4
Hi

I am using oracle 10 g db.
In a table i set sysdate for a column in the db.
I am trying to insert a row into the table, I didn't pass any value to the date field.
while I select the table it is showing date as null.
I want the default value to be inserted in the field every time i insert a record.

I tried the following ways in mapping file:
I put dynamic-insert true in class tag.
I put default="SYSDATE" in the column tag.

above 2 method not working .
Please help me with this..........


Top
 Profile  
 
 Post subject: Re: db default value
PostPosted: Wed Nov 10, 2010 12:59 pm 
Beginner
Beginner

Joined: Tue Oct 26, 2010 6:12 pm
Posts: 29
dynamic-insert should be set to false in your case. I believe you would have to use @Generated on your properties with the corresponding generationtime values.

http://docs.jboss.org/hibernate/core/3. ... -generated


Top
 Profile  
 
 Post subject: Re: db default value
PostPosted: Thu Nov 11, 2010 12:38 pm 
Newbie

Joined: Mon Sep 14, 2009 5:27 am
Posts: 4
hi
i am having a mapping with full of composite keys i.e <key-property><column/></key-property>
So please tell me where to place generated="always"


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.