需求:创建一张主键是varchar(255)类型的,并且有一个属性是timestamp类型的,那么javaBean可以这么配置:
id:String
time:Timestamp
xml配置文件:
<hibernate-mapping>
<class name="cn.szy.domain.User" table="user">
<id name="id" type="java.lang.String">
<generator class="uuid"></generator>
</id>
<property name="time" generated="never" not-null="true">
<column name="time" sql-type="timestamp"></column>
</property>
</class>
</hibernate-mapping>