mysql - Hibernate mapping doesn't allow null timestamp -
mysql - Hibernate mapping doesn't allow null timestamp -
i developing web based application using spring-hibernate combination mysql database. have observed 1 problem hibernate mapping doesn't allow me set null, when type timestamp. here code snippet improve understanding
here agenda - want allow user come in null value endtime, not sttime.
schedule.htm.xml
<id name="id" type="long" column="test_run_schedule_id" > <generator class="increment" /> </id> <property name="testname" type="java.lang.string" column="test_run_name" not-null="true" length="45" /> <property name="operation" type="java.lang.string" column="operation_included" not-null="true" length="500" /> <property name="sttime" type="java.util.date" column="start_time" not-null="true" length="19" /> <property name="endtime" type="java.util.date" column="end_time" not-null="false" length="19" />
when looked mysql database, showing me columns start_time [timestamp, notnull]
, end_time [timestamp, notnull]
instead of end_time[timestamp, null]
.
so when insert value, end_time
taken current_timestamp
default.
how create nullable end_time
column?
mysql database hibernate hbm
Comments
Post a Comment