-->
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: date no auto generated when speficy in mapping.
PostPosted: Thu Jun 05, 2008 6:54 am 
Beginner
Beginner

Joined: Mon Dec 17, 2007 11:08 pm
Posts: 47
hi,

i had declared a element in my hbm.xml to generate, however, when insert and update is execute. I cannot see any date value but null instead.

my elements is same almost same like the one in hibernate in action.

<property name="lastModified"
update="false"
insert="false"
generated="always"/>

it will generated Datetime Type for MYSQL. but when i change to timestamp, it work like what i though (every insert and update is generated the date value).

am my mapping is incorrect ?

i receive this error

2008-06-05 18:44:14,942 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 1364, SQLState: HY000>
2008-06-05 18:44:14,942 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Field 'lastModified' doesn't have a default value>
org.hibernate.exception.GenericJDBCException: could not insert: [com.XXX.ClassName]
....... //other exceptin

_________________
happy hacking !


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.