[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-725) hbm2java generate wrong type for hibernate type "timestamp"

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Wed Aug 9 02:35:19 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-725?page=comments#action_23880 ] 

Max Rydahl Andersen commented on HBX-725:
-----------------------------------------

what granularity do you want ? the Date has downto milliseconds. This is the expected behavior.

> hbm2java generate wrong type for hibernate type "timestamp"
> -----------------------------------------------------------
>
>          Key: HBX-725
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-725
>      Project: Hibernate Tools
>         Type: Bug

>   Components: hbm2java
>     Versions: 3.2beta6
>  Environment: Window XP, java 1.4.2
>     Reporter: wanhing

>
>
> When I use "timestamp" in the mapping definition file, the generated java class has "Date" instead. As a result I lost the granuity that I need. Example:
> ====================================================================
>   <class name="TaskDuration">
>     <meta attribute="class-description">
>       @jboss-net.xml-schema urn="tms:TaskDuration"
>     </meta>
>     <id name="id" column="TaskDurationId" type="long" >
>       <generator class="native"/>
>     </id>
>     <version name="version" />    
>         
>     <property name="datetime"   type="timestamp" not-null="true"/>
>     <property name="duration"   type="float"     not-null="true"/>
>  </class>
> =====================================================================
> The generated java class has:
> public class TaskDuration  implements java.io.Serializable {
>  ....
>      private Date datetime;
>     public void setDatetime(Date datetime) {
>         this.datetime = datetime;
>     }
>     public Date getDatetime() {
>         return this.datetime;
>     }
>  ...
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list