[Hibernate-JIRA] Created: (HHH-2987) Would like HQL support in criteria.Order
by Mark Lundquist (JIRA)
Would like HQL support in criteria.Order
----------------------------------------
Key: HHH-2987
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2987
Project: Hibernate3
Issue Type: Improvement
Affects Versions: 3.2.5, 3.2.4.sp1, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0.ga, 3.2.0.cr5, 3.2.0.cr4, 3.2.0.cr3, 3.2.0.cr2, 3.2.0 cr1, 3.1.3, 3.2.0.alpha2, 3.2.0.alpha1, 3.1.2, 3.1.1, 3.1, 3.1 rc3, 3.1 rc2, 3.1 rc 1, 3.1 beta 2, 3.1 beta 1, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1
Reporter: Mark Lundquist
Priority: Minor
I just rewrote part of an application to use the Criterion API, and this was mostly a win, but... the old implementation had an "order by ucase (name)", and I cannot now say:
crit.addOrder (Order.asc ("ucase (name)"));
because Order doesn't do HQL, it just wants a property name. It would be nice if Order supported HQL.
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 1 month
[Hibernate-JIRA] Created: (HHH-2978) Using HQL index() on a <index-many-to-many..> key in a <map...> cannot dereference any properties of the key - java.lang.NullPointerException
by James Andrews (JIRA)
Using HQL index() on a <index-many-to-many..> key in a <map...> cannot dereference any properties of the key - java.lang.NullPointerException
---------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-2978
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2978
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.5
Environment: Hibernate 3.2.5 GA, MySQL 5.0.27 Community NT, Eclipse 3.1.1, Hibernate Tools 3.2 beta 9
Reporter: James Andrews
As mentioned in summary, using a mapped POJO as the index of a <map..> relationship, via the <index-many-to-many class="..> approach.
Using a table join, for instance:
select index(depts), depts
from ModificationFixed fixed
left join fixed.departments depts
Will fetch Department instances for each value, but if you instead try to fetch a property of the index:
select index(depts).name, depts
from ModificationFixed fixed
left join fixed.departments depts
then this causes the aforementioned NullPointerException, both in the hibernate tools preview, and in practise when trying to execute the query, with the following stack trace:
Exception in thread "main" java.lang.NullPointerException
at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(HqlSqlWalker.java:444)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.propertyRef(HqlSqlBaseWalker.java:1080)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:1881)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:1825)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1394)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:553)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:115)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at intranet.db.PersistentMySQL.createQueryArray(PersistentMySQL.java:154)
at intranet.budget.planner.ModificationFixed.main(ModificationFixed.java:165)
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 1 month
[Hibernate-JIRA] Created: (HHH-2986) Patch fixing HHH-2962 - "ResultCheckStyle.PARAM does not work with PostgreSQL"
by Julius Stroffek (JIRA)
Patch fixing HHH-2962 - "ResultCheckStyle.PARAM does not work with PostgreSQL"
------------------------------------------------------------------------------
Key: HHH-2986
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2986
Project: Hibernate3
Issue Type: Patch
Affects Versions: 3.2.5, 3.2.6, 3.3, 3.4
Environment: Hibernate 3.2.5, PostgreSQL 8.2 & 8.3beta
Reporter: Julius Stroffek
Attachments: hibernate.diff
I have created a simple test application which uses a stored procedure
to insert a record into a database using hibernate. I used hibernate
annotations and have overridden insert statement by
@SQLInsert(callable=true, sql="{? = call insert_party(?, ?, ?, ?)}",
check=ResultCheckStyle.PARAM)
However, hibernate throws the exception
...
Caused by: org.hibernate.exception.GenericJDBCException: could not extract row counts from CallableStatement
at org.hibernate.jdbc.Expectations$BasicParamExpectation.determineRowCount(Expectations.java:123)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:41)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2251)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2661)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:516)
... 50 more
Caused by: org.postgresql.util.PSQLException: Parameter of type java.sql.Types=2 was registered, but call to getInt (sqltype=java.sql.Types=4) was made.
at org.postgresql.jdbc2.AbstractJdbc2Statement.checkIndex(AbstractJdbc2Statement.java:2387)
at org.postgresql.jdbc2.AbstractJdbc2Statement.getInt(AbstractJdbc2Statement.java:1920)
at org.hibernate.jdbc.Expectations$BasicParamExpectation.determineRowCount(Expectations.java:119)
... 62 more
The patch fixes this issue by calling CallableStatement.getBigDecimal(parameterPosition).intValue() instead of CallableStatement.getInt(paramterPosition).
I studied JDBC3 specification whether PostgreSQL driver is wrong
or not and I think that the driver is correct. There is a conversion table
on page B-182 which should correspond to ResultSet object getter
methods only. There is nothing about the conversion being done
in CallableStatement's getter methods.
Hibernate should use CallableStatement.getBigDecimal(parameterIndex).intValue()
to obtain a value of a output parameter of NUMERIC data type.
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 1 month
[Hibernate-JIRA] Created: (HHH-2709) Informix dialect generates incorrect ALTER TABLE statement
by Ovidiu Feodorov (JIRA)
Informix dialect generates incorrect ALTER TABLE statement
----------------------------------------------------------
Key: HHH-2709
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2709
Project: Hibernate3
Issue Type: Bug
Components: metamodel
Affects Versions: 3.2.4, 3.2.3, 3.2.2, 3.2.1
Environment: Informix Dynamic Server 10.00.UC6, JDBC driver 3.00.JC3
Reporter: Ovidiu Feodorov
org.hibernate.dialect.InformixDialect shipping with Hibernate 3.2.1 - 3.2.4 generates corrupted SQL, at least relative to Informix Dynamic Server 10.00.UC6.
2007-07-02 18:14:47,011 ERROR SchemaExport:274 - Unsuccessful: alter table A add constraint foreign key (B_ID) references collection constraint FK4AA13DBAA4271173 on delete cascade
2007-07-02 18:14:47,011 ERROR SchemaExport:275 - A syntax error has occurred.
This is what the Dialect generates:
alter table A add constraint foreign key ( B_ID) references collection constraint FKBC16C978A4271173 on delete cascade
This is what works:
alter table A add constraint foreign key (B_ID) references collection on delete cascade constraint FKBC16C978A4271173
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 1 month