[Hibernate-JIRA] Closed: (HHH-1286) Set entity in HQL query without prefix -> incorrect SQL
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1286?page=c... ]
Steve Ebersole closed HHH-1286.
-------------------------------
Closing stale resolved issues
> Set entity in HQL query without prefix -> incorrect SQL
> -------------------------------------------------------
>
> Key: HHH-1286
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1286
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1
> Environment: PostgreSQL 8.0.1
> Reporter: Ronald Wildenberg
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: 3.1.1
>
> Attachments: hibernate.cfg.xml, model.zip
>
>
> Suppose two entities: Term and Indeling with:
> Term.java:
> private Indeling indeling;
> @ManyToOne(cascade = { CascadeType.REFRESH }, optional = false, fetch = FetchType.EAGER)
> @JoinColumn(name = "indeling_id")
> public Indeling getIndeling() {
> return indeling;
> }
> Indeling.java:
> private Set<Term> termen = new HashSet<Term>();
> @OneToMany(mappedBy = "indeling", cascade = { CascadeType.REMOVE })
> public Set<Term> getTermen() {
> return termen;
> }
> and a HQL query in package-info.java: "from Term where indeling = :indeling"
> Hibernate generates an SQL statement with the following where clause: "where indeling=?". The join column, however, is indeling_id.
> A workaround for this issue is to change the HQL query to: "from Term term where term.indeling = :indeling", using an alias.
> Attached you will find model.zip (with Term.java, Indeling.java and package-info.java) and hibernate.cfg.xml.
--
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
15 years
[Hibernate-JIRA] Closed: (HHH-814) Cached queries cannot be cleared from SessionFactoryImpl.softQueryCache field
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-814?page=co... ]
Steve Ebersole closed HHH-814.
------------------------------
Closing stale resolved issues
> Cached queries cannot be cleared from SessionFactoryImpl.softQueryCache field
> -----------------------------------------------------------------------------
>
> Key: HHH-814
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-814
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Environment: Hibernate 2.1, 3.0. Oracle database.
> Reporter: Peter Severin
>
> Our application is deployed a little bit differently than usual. Hibernate is loaded and initialized by the main container classloader and the actual application is loaded by a child classloader (like a web application in a web container). The problem arises when the application is reloaded by discarding the child classloader and creating another one.
> The problem is that when using scalar queries with a holder class (select new MyClass), after the application reload hibernate will continue creating instances of the holder class that was loaded using the old classloader. It seems that Hibernate actually holds a reference to this class somewhere. I did some research in the source code and it seems that the queries(QueryTranslator having the field holderClass) are stored in the private softQueryCache field of the SessionFactoryImpl which is never cleared and there is no publicly accessible methods that would allow this.
--
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
15 years
[Hibernate-JIRA] Closed: (HHH-1404) ordinal parameter mismatch
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1404?page=c... ]
Steve Ebersole closed HHH-1404.
-------------------------------
Closing stale resolved issues
> ordinal parameter mismatch
> --------------------------
>
> Key: HHH-1404
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1404
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.1.1
> Environment: Windows XP SP2, JDK 1.5.0_06-b05, Spring 1.2.6, antlr-2.7.6rc1
> Reporter: Artur Wronski
> Priority: Critical
> Attachments: RecognizerBug.java
>
>
> After migration from Hibernate 3.0.5 to Hibernate 3.1.1. this query fails:
> StringBuilder q = new StringBuilder("from domain.Order o ")
> .append("where o.status in (?, ?) and o.paid = ? and o.stockAgreed = ? and ")
> .append("o.reminderDate is not null and o.orderRecallDate < ? ");
>
> return getSession()
> .createQuery(q.toString())
> .setInteger(0, 1)
> .setInteger(1, 2)
> .setBoolean(2, false)
> .setBoolean(3, true)
> .setTimestamp(4, new Date())
> .list();
> with exception:
> org.hibernate.HibernateException: ordinal parameter mismatch
> at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:225)
> at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:95)
> at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
> at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
> at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:134)
> at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:113)
> Thanks for help,
> Arthur
--
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
15 years
[Hibernate-JIRA] Closed: (HHH-1485) Addition of mapping-bundle or similar feature to configuration file
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1485?page=c... ]
Steve Ebersole closed HHH-1485.
-------------------------------
Closing stale resolved issues
> Addition of mapping-bundle or similar feature to configuration file
> -------------------------------------------------------------------
>
> Key: HHH-1485
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1485
> Project: Hibernate Core
> Issue Type: New Feature
> Environment: Any
> Reporter: tenwit
> Assignee: Steve Ebersole
> Priority: Trivial
>
> Many of the projects I work on result in jars that use hibernate to provide data access facilities to multiple applications (e.g. separate bulk import applications, reporting applications, web and swing front-ends, all over the same DB). Many of these applications use several jars (because they deal with data from several databases). Each application has to maintain its own set of <mapping> elements in its .cfg.xml file. These are getting very cumbersome now: the apps that deal with all of the databases have upwards of 120 .hbm.xml files imported.
> I'd like to suggest a new file, maybe a .map.xml file, that bundles <mapping> elements but doesn't do any configuration stuff. Each of the jars could include one of these files, which would be imported much like individual mapping files (a new <mapping-bundle> element in the .cfg.xml file, maybe?). The file format wouldn't need anything more than a <mapping-bundle> top level element, and the <mapping> element already in the .cfg.xml files. This would reduce the maintenance effort required in apps that follow the same sort of model as mine do.
--
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
15 years
[Hibernate-JIRA] Closed: (HHH-1080) HQL delete fails on entities with where-fragments using operators other than '='
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1080?page=c... ]
Steve Ebersole closed HHH-1080.
-------------------------------
Closing stale resolved issues
> HQL delete fails on entities with where-fragments using operators other than '='
> --------------------------------------------------------------------------------
>
> Key: HHH-1080
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1080
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 rc 1, 3.1 rc2
> Environment: Hibernate v3.1rc2, HSQLDB1.7.3.3
> Reporter: Kemal Erdogan
> Assignee: Steve Ebersole
> Fix For: 3.1 rc3
>
>
> The 3rd line of the following snippet fails to execute and creates a java.lang.StringIndexOutOfBoundsException:
> s.createQuery("delete from Bar").executeUpdate();
> s.createQuery("delete from Baz").executeUpdate();
> s.createQuery("delete from Foo").executeUpdate();
> It is the "org.hibernate.test.Foo" Bar and Baz under Hibernate test suite. I used the paremeters and settings under /etc folder of Hibernate distribution.
> I just addes these 3 lines to the top of org.hibernate.test.legacy.FooBarTest.testQuery()
> s.createQuery("delete from Bar").executeUpdate();
> s.createQuery("delete from Baz").executeUpdate();
> s.createQuery("delete from Foo").executeUpdate();
> Here is the stack trace:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -1
> at java.lang.String.substring(Unknown Source)
> at org.hibernate.hql.ast.util.SyntheticAndFactory.parseEqFragmentToSubtree(SyntheticAndFactory.java:135)
> at org.hibernate.hql.ast.util.SyntheticAndFactory.addDiscriminatorWhereFragment(SyntheticAndFactory.java:119)
> at org.hibernate.hql.ast.HqlSqlWalker.postProcessDML(HqlSqlWalker.java:507)
> at org.hibernate.hql.ast.HqlSqlWalker.postProcessDelete(HqlSqlWalker.java:524)
> at org.hibernate.hql.antlr.HqlSqlBaseWalker.deleteStatement(HqlSqlBaseWalker.java:446)
> at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:245)
> at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:216)
> at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:156)
> at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:103)
> at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:473)
> at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1060)
> at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1041)
> at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)
> at org.hibernate.test.legacy.FooBarTest.testQuery(FooBarTest.java:337)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at org.hibernate.test.TestCase.runTest(TestCase.java:140)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
--
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
15 years