From: <no...@at...> - 2006-07-10 16:58:59
|
SYSDATE and SYSTIMESTAMP not working well with Hibernate 3.1.3 and Oracle 1= 0.2.0.1 ---------------------------------------------------------------------------= ------- Key: HHH-1893 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH= -1893 Project: Hibernate3 Type: Bug Components: query-sql =20 Versions: 3.1.3 =20 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 part.= 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.j= ava:161)=20 at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.= 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(Loade= r.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:142= )=20 at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:164)=20 at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java= :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 D= UAL").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 |
From: Christian B. (JIRA) <no...@at...> - 2006-07-10 17:17:56
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?p= age=3Dall ] =20 Christian Bauer resolved HHH-1893: ---------------------------------- Resolution: Rejected Stay on the user forum, this is not a support portal. > 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 |
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 |
From: Christian B. (JIRA) <no...@at...> - 2006-07-10 22:21:58
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?pa= ge=3Dcomments#action_23590 ]=20 Christian Bauer commented on HHH-1893: -------------------------------------- This is of course not a bug Next time, please do the search on the forum fi= rst, as I did just now.=20 http://forum.hibernate.org/viewtopic.php?t=3D941520&highlight=3Dsysdate+cre= atesqlquery > 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 |
From: <no...@at...> - 2006-07-11 16:48:56
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?pa= ge=3Dcomments#action_23598 ]=20 Nestor Bosc=C3=A1n commented on HHH-1893: ------------------------------------ Yes As you can see in the forum thread Hibernate should choose to return date a= nd time information like JDBC does. And this not only fails with select sys= date from dual but also for any view or table that has date information. > 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 |
From: Max R. A. (JIRA) <no...@at...> - 2006-07-11 16:53:56
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?pa= ge=3Dcomments#action_23599 ]=20 Max Rydahl Andersen commented on HHH-1893: ------------------------------------------ so do like the forum thread suggest you to or on 3.2 customize your oracled= ialect to register the non-standard -101 type as the type you want. btw. this is not a bug in 3.1.3 since that version does not support autodis= covery of types. > 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 |
From: <no...@at...> - 2006-07-11 17:15:00
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?pa= ge=3Dcomments#action_23600 ]=20 Nestor Bosc=C3=A1n commented on HHH-1893: ------------------------------------ Yes That's for the "timestamp" data type that's new in Oracle 9. But in this ca= se of the "date" data type it should return date and time information. > 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 |
From: Max R. A. (JIRA) <no...@at...> - 2006-07-11 17:32:59
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?pa= ge=3Dcomments#action_23601 ]=20 Max Rydahl Andersen commented on HHH-1893: ------------------------------------------ dude, go report to Oracle why they report -101 for this query. The solution for 3.1 and the workaround on 3.2 for it have already been exp= lained to you. Last comment from me here - go to the user forum if you want more help. > 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 |
From: <no...@at...> - 2006-07-11 17:39:59
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?pa= ge=3Dcomments#action_23602 ]=20 Nestor Bosc=C3=A1n commented on HHH-1893: ------------------------------------ Nice attitude. You should read first and then answer.=20 > 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 |
From: Max R. A. (JIRA) <no...@at...> - 2006-07-11 19:19:57
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1893?pa= ge=3Dcomments#action_23603 ]=20 Max Rydahl Andersen commented on HHH-1893: ------------------------------------------ The solution and workaround *has* still been documented and you forgot to r= ead the part of us telling you to use the forum to discuss this. Oracle is apparently returning DATE as type where it should return TIMESTAM= P. I kindly ask you (again) to go to the user forum if you want to keep discus= sing oracle fun or=20 If you think you have a better (and correct) solution then patches are welc= ome. QED > 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 |