[Hibernate-JIRA] Updated: (HHH-530) Allow application of filters on subqueries
by Heiko Burchard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Heiko Burchard updated HHH-530:
-------------------------------
Attachment: HqlSqlWalker-branch32.patch
Maybe I found a solution to our problem. For the left outer joins where the parameters are lost HqlSqlWalker.handleWithFragment is called, which constructs a new SqlGenerator. If I add the collectedParameters of this SqlGenerator to the fromElements embeddedParameters all the query parameters are correctly bound and the query is executed. But I'm not sure if this is the right place to "rescue" those parameters...
A Patch for branch 3.2 is attached.
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.2.x, 3.3.x, 3.4
>
> Attachments: HHH-530.3.3.SP1.patch, HHH-530.3.3.SP1.take2.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, HqlSqlWalker-branch32.patch, HqlWithFiltersTest.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
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, 6 months
[Hibernate-JIRA] Created: (HHH-3594) Hibernate collection listener throw exception when adding entity to the collection
by louie (JIRA)
Hibernate collection listener throw exception when adding entity to the collection
----------------------------------------------------------------------------------
Key: HHH-3594
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3594
Project: Hibernate Core
Issue Type: Bug
Components: envers
Environment: Hibernate Manager 3.4.0.GA (hibernate core 3.3.1.GA) and Envers 1.1.0.GA
Reporter: louie
Attachments: envers-1.1.0.zip
For the entity which has one-to-many relationship, in the case of enable the following listeners:
<property name="hibernate.ejb.event.pre-collection-update" value="org.jboss.envers.event.VersionsEventListener" />
<property name="hibernate.ejb.event.pre-collection-remove" value="org.jboss.envers.event.VersionsEventListener" />
<property name="hibernate.ejb.event.post-collection-recreate" value="org.jboss.envers.event.VersionsEventListener" />
If add a new entry in the one-to-many collection object, when we try to persist this entity. The Envers throws the following exception
Nov 10, 2008 12:10:07 PM org.hibernate.transaction.JDBCTransaction notifyLocalSynchsBeforeTransactionCompletion
SEVERE: exception calling user Synchronization
Shuting down Hibernate JPA layer.
org.hibernate.PropertyAccessException: could not get a field value by reflection getter of com.hibernate.envers.bug.EntityTwo.entityOne
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:58)
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.getForInsert(DirectPropertyAccessor.java:63)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTuplizer.java:294)
at org.hibernate.tuple.entity.PojoEntityTuplizer.getPropertyValuesToInsert(PojoEntityTuplizer.java:239)
at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValuesToInsert(AbstractEntityPersister.java:3696)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at org.hibernate.ejb.event.EJB3SaveEventListener.saveWithGeneratedId(EJB3SaveEventListener.java:43)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:562)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:550)
at org.jboss.envers.synchronization.work.PersistentCollectionChangeWorkUnit.perform(PersistentCollectionChangeWorkUnit.java:67)
at org.jboss.envers.synchronization.VersionsSync.executeInSession(VersionsSync.java:120)
at org.jboss.envers.synchronization.VersionsSync.beforeCompletion(VersionsSync.java:144)
at org.hibernate.transaction.JDBCTransaction.notifyLocalSynchsBeforeTransactionCompletion(JDBCTransaction.java:274)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:140)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
at com.hibernate.envers.bug.AppTest.testPersistence(AppTest.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by: java.lang.IllegalArgumentException: Can not set com.hibernate.envers.bug.EntityOne field com.hibernate.envers.bug.EntityTwo.entityOne to java.util.HashMap
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:18)
Stopping in-memory HSQL database.
Building JPA EntityManager for unit tests
at java.lang.reflect.Field.get(Field.java:358)
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:55)
... 48 more
Nov 10, 2008 12:10:07 PM org.hibernate.impl.SessionFactoryImpl close
Attached is the test project which include this test case.
--
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, 6 months
[Hibernate-JIRA] Commented: (HHH-530) Allow application of filters on subqueries
by Heiko Burchard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Heiko Burchard commented on HHH-530:
------------------------------------
It did not - the filter parameters get bound, the other parameters not.
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.2.x, 3.3.x, 3.4
>
> Attachments: HHH-530.3.3.SP1.patch, HHH-530.3.3.SP1.take2.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, HqlWithFiltersTest.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
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, 6 months
[Hibernate-JIRA] Created: (HHH-3597) Schema generation creates redundant indexes when using the Mysql5InnodbDialect
by Mark Matthews (JIRA)
Schema generation creates redundant indexes when using the Mysql5InnodbDialect
------------------------------------------------------------------------------
Key: HHH-3597
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3597
Project: Hibernate Core
Issue Type: Bug
Components: core
Environment: MySQL and any version of Hibernate with the Mysql5InnodbDialect (I checked trunk, the issue is still there)
Reporter: Mark Matthews
Priority: Critical
Mysql5InnodbDialect incorrectly adds indexes when adding foreign key constraints. Since MySQL-4.1.2, Innodb has automatically added an index if needed, or re-uses one if it can when adding a foreign key constraint. Adding it by "hand" creates a duplicate index, which wastes resources (i/o, cpu, disk space).
Reworking the following method fixes the issue:
@Override
public String getAddForeignKeyConstraintString(
String constraintName,
String[] foreignKey,
String referencedTable,
String[] primaryKey, boolean referencesPrimaryKey) {
String cols = StringHelper.join(", ", foreignKey);
return new StringBuffer(30)
.append(" add constraint ")
.append(constraintName)
.append(" foreign key (")
.append(cols)
.append(") references ")
.append(referencedTable)
.append(" (")
.append( StringHelper.join(", ", primaryKey) )
.append(')')
.toString();
}
--
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, 6 months
[Hibernate-JIRA] Commented: (HHH-530) Allow application of filters on subqueries
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Steve Ebersole commented on HHH-530:
------------------------------------
Yes, HSQLDB threw me for a loop there. I will be looking at moving to H2 as the default in the near future.
Meanwhile, I committed some changes just yesterday to account for the failures we saw in the existing tests in the hudson runs. Try with the latest code from the 3.2 branch and see if that alleviates your issues.
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.2.x, 3.3.x, 3.4
>
> Attachments: HHH-530.3.3.SP1.patch, HHH-530.3.3.SP1.take2.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, HqlWithFiltersTest.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
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, 6 months