[
http://opensource.atlassian.com/projects/hibernate/browse/HBX-725?page=all ]
Max Rydahl Andersen closed HBX-725:
-----------------------------------
Resolution: Fixed
use <meta attribute="property-type">java.sql.Timestamp</meta> if you
want to be dependent on on java.sql.*
and java.util.Date date = new Timestamp(); does compile.
Furthermore read up about what the difference is between "date",
"time" and "timestamp" in hibernate mappings.
And finally, use the tools forum for question like this :)
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira