TimeStamp instead of Date Object behind @Temporal(TemporalType.TIMESTAMP)

Description

As stated in the java api (http://java.sun.com/javase/6/docs/api/java/sql/Timestamp.html)
"Due to the differences between the Timestamp class and the java.util.Date class mentioned above, it is recommended that code not view Timestamp values generically as an instance of java.util.Date. The inheritance relationship between Timestamp and java.util.Date really denotes implementation inheritance, and not type inheritance. "

A Timestamp object should not be hided by a Date object. Therefore hibernate should no place a Timestamp object behind that.

@NotNull
@Temporal(TemporalType.TIMESTAMP)
private Timestamp createDate;

Instead hibernate has to do something like this behind the scences:
createDate = new Date(createDateTimestamp.getTime())

Environment

None

Activity

Show:
Gail Badner
April 22, 2010, 1:08 AM

Is this still an issue using 3.5.1?

If so, please attach a runnable test case (Java + mapping) that reproduces this issue.

Also, please attach a patch with your fix.

Brett Meyer
December 20, 2013, 5:27 PM

closing – no test case or additional details received

Rejected

Assignee

Unassigned

Reporter

Yves Senn

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure