I am trying to create a mapping in hibernate that has a <id> that
1) is a Timestamp (yyyy/mm/dd.hh.mm.ss.sss) (not a DateTime)
2) using a MYSQL database
3) where I provide the Timestamp value using my getters and setters and is not automaticly assigned by the JVM or DB.
4) that will not change when I update the record in the DB.
I am using:
1) MYSQL 5.2.26
2) Hibernate 3
How should I change the mapping (hbm.xml) so that it stops changing the Timestamp value when a update occurs. I only what the timestamp value assigned when writing a new record and from that point forward it should not change.
How should I change the mapping (hbm.xml) so that I get the microseconds because currently I only get data in MYSQL in the following format yyyy/mm/dd.hh.mm.ss. I wan/need to micro seconds because I can generate more than 1 record per second.
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.microfirst.drink.request.beans.FloorConfigurations" table="BVODFCMP">
<id name="fcStamp" type="java.sql.Timestamp">
<column name="FCSTAMP" />
<generator class="assigned"/>
</id>
<property name="fcConfigName" type="string" column="FCCFGNAME" length="20" />
<property name="fcBar" type="string" column="FCBAR" length="20" />
<property name="fcMapName" type="string" column="FCMAPNAME" length="20" />
<property name="fcBevZone" type="string" column="FCBEVZONE" length="10" />
<property name="fcStatus" type="string" column="FCSTATUS" length="01" />
</class>
</hibernate-mapping>