Java type for date/time when using Oracle Date with Hibernate -
We have an oracle date column. We were using java.sql.Date
in our Java / Hibernate class first. It works but when the database is saved no information is stored at any time in the database, then I changed the Java data type to a timestamp. Now we get this error:
springframework.beans.factory.BeanCreationException: Error class path processing [ Defined in margins -service-domain -config.xml]: The start of Bean failed; Nested exception org.springframework.beans.factory.BeanCreatio nException: Error creating bean with name 'sessionFactory' defined in class path resource [m-service-doma in-config.xml]: invocation of init method failed; Nested exception org.hibernate.HibernateException: Wrong column type: CREATE_TS, expected: timestamp
Any ideas about maintaining a Oracle date
map part time ?
Update: If I use the Oracle timestamp
data type, I can get it to do this work, but I can accurately model that level Not just the original Oracle date
.
Do not want a direct answer, but I use 'D' Oracle timestamp type:
< Blockquote> TIMESTAMP (partial_ seconds_exact) year of the year, month and day value, as well as other values of hour, minute, and time, where fractional_seconds_precision < / Code> Alternatively specifies the number of digits in the partial part of the SECOND
datetime field and a number can be in the range of 0 to 9, default is 6. For example, you specify TIMESTAMP
in a literal form as follows: TIMESTAMP'1997-01-31 09: 26: 50.124 '
< / Pre> Desired fractional_second_precision
.
Comments
Post a Comment