From: <no...@at...> - 2006-07-10 21:07:03
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?pa= ge=3Dcomments#action_23589 ]=20 Nestor Bosc=C3=A1n commented on HHH-1893: ------------------------------------ I know this is not a support portal. But this is not a support question, TH= IS IS A BUG in Hibernate 3.1.3 and I'm posting this bug in hope that somebo= dy in the future can fix it so Hibernate can be a better product. > SYSDATE and SYSTIMESTAMP not working well with Hibernate 3.1.3 and Oracle= 10.2.0.1 > -------------------------------------------------------------------------= --------- > > Key: HHH-1893 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1893 > Project: Hibernate3 > Type: Bug > Components: query-sql > Versions: 3.1.3 > Reporter: Nestor Bosc=C3=A1n > Priority: Minor > > > Trying to use sysdate or systimestamp in SQL Queries with Oracle database= .=20 > If I use sysdate Hibernate is not retrieving the hour, minute, second par= t. I always get 12:00:00pm=20 > If I use systimestamp I get the following exception:=20 > org.hibernate.MappingException: No Dialect mapping for JDBC type: -101=20 > at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)=20 > at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)=20 > at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:192)= =20 > at org.hibernate.loader.custom.CustomLoader.getHibernateType(CustomLoader= .java:161)=20 > at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoade= r.java:131)=20 > at org.hibernate.loader.Loader.getResultSet(Loader.java:1678)=20 > at org.hibernate.loader.Loader.doQuery(Loader.java:662)=20 > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loa= der.java:224)=20 > at org.hibernate.loader.Loader.doList(Loader.java:2145)=20 > at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)=20 > at org.hibernate.loader.Loader.list(Loader.java:2024)=20 > at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:111)= =20 > at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1655)= =20 > at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:1= 42)=20 > at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:164)=20 > at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.ja= va:749)=20 > Hibernate version: 3.1.3=20 > Code between sessionFactory.openSession() and session.close():=20 > Session session =3D null;=20 > Date date;=20 > try=20 > {=20 > session =3D sessionFactory.openSession ();=20 > date =3D (Date) session.createSQLQuery ("SELECT SYSDATE CURRENT_DATE FROM= DUAL").uniqueResult ();=20 > }=20 > finally=20 > {=20 > try=20 > {=20 > if (session !=3D null) session.close ();=20 > }=20 > catch (HibernateException e2) {}=20 > }=20 > System.out.println (new SimpleDateFormat ("hh:mm:ss").format (date));=20 > Name and version of the database you are using: Oracle 10.2.0.1 --=20 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 |