wgblackmon wrote:
Hi,
I'm a total newbie to Hibernate so please bear with me. I'm reading a datetime datatype field from a Sybase database and it is not being cast correctly according to Hibernate. I've looked elsewhere for casting examples between the datetime field and other date definitions and have come up empty handed.
The definitions and error message follow:
VendorEntity.hbm.xml def for field
<property name="beginningDate" column="beginning_date" type="timestamp" not-null="false" />
Sybase table definition for field
datatype = datetime, nulls = yes
Field definition in POJO file
private java.sql.Date beginningDate;
setter method signature
setBeginningDate(java.sql.Date beginningDate)
Value passed from Sybase database that causes set method to crash
9/9/2004 8:29:45.653 AM
....
Any help would be GREATLY appreciated!
Since you've mapped the property as Timestamp, wouldn't it make sense for your setter method to take a java.sql.Timestamp ?