[Hibernate-JIRA] Resolved: (HHH-1595) SQL syntax error on delete statement with subselect
by Strong Liu (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1595?page=c... ]
Strong Liu resolved HHH-1595.
-----------------------------
Resolution: Incomplete
> SQL syntax error on delete statement with subselect
> ---------------------------------------------------
>
> Key: HHH-1595
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1595
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3, Oracle 10g
> Reporter: Georgios Skempes
> Assignee: Strong Liu
>
> After upgrading from Hibernate 3.1.2 to 3.1.3 I get an SQL syntax error for the HQL statement below. It's a bulk delete containing a subselect. The code is working for Hibernate 3.1.2
> Code between session.open() and session.close():
> ------------------------------------------------------------------------
> String queryString = "delete from Contact con where con.Id.ConpId IN (select conp.Id from con.ContactpersonSet conp where conp.ParId=4711)
> Query queryObject = session.createQuery(queryString);
> queryObject.executeUpdate();
> SQL code generated with Hibernate 3.1.2 (correct):
> ----------------------------------------------------------------------
> delete from CONTACTS where CONP_ID in (select contactper1_.Id from CONTACTPERSONS contactper1_ where CONP_ID=contactper1_.Id and PAR_ID=4711)
> SQL code generated with Hibernate 3.1.3 (error):
> -----------------------------------------------------------------------
> delete from CONTACTS where CONP_ID in (select contactper1_.Id from CONTAKTPERSONS contactper1_ where contact0_.CONP_ID=contactper1_.Id and contactper1_.PAR_ID=?)
> Error log:
> -----------------------------------------------------------------------
> [08:43:01,591] (ERROR) org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:72) - ORA-00904: "CONTACT0_"."CONP_ID": invalid identifier
--
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, 12 months
[Hibernate-JIRA] Reopened: (HHH-1595) SQL syntax error on delete statement with subselect
by Strong Liu (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1595?page=c... ]
Strong Liu reopened HHH-1595:
-----------------------------
> SQL syntax error on delete statement with subselect
> ---------------------------------------------------
>
> Key: HHH-1595
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1595
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3, Oracle 10g
> Reporter: Georgios Skempes
> Assignee: Strong Liu
>
> After upgrading from Hibernate 3.1.2 to 3.1.3 I get an SQL syntax error for the HQL statement below. It's a bulk delete containing a subselect. The code is working for Hibernate 3.1.2
> Code between session.open() and session.close():
> ------------------------------------------------------------------------
> String queryString = "delete from Contact con where con.Id.ConpId IN (select conp.Id from con.ContactpersonSet conp where conp.ParId=4711)
> Query queryObject = session.createQuery(queryString);
> queryObject.executeUpdate();
> SQL code generated with Hibernate 3.1.2 (correct):
> ----------------------------------------------------------------------
> delete from CONTACTS where CONP_ID in (select contactper1_.Id from CONTACTPERSONS contactper1_ where CONP_ID=contactper1_.Id and PAR_ID=4711)
> SQL code generated with Hibernate 3.1.3 (error):
> -----------------------------------------------------------------------
> delete from CONTACTS where CONP_ID in (select contactper1_.Id from CONTAKTPERSONS contactper1_ where contact0_.CONP_ID=contactper1_.Id and contactper1_.PAR_ID=?)
> Error log:
> -----------------------------------------------------------------------
> [08:43:01,591] (ERROR) org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:72) - ORA-00904: "CONTACT0_"."CONP_ID": invalid identifier
--
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, 12 months
[Hibernate-JIRA] Created: (HHH-5129) TransientObjectException thrown in cascading collection with DELETE_ORPHAN if object is added and removed from collection
by José González Gómez (JIRA)
TransientObjectException thrown in cascading collection with DELETE_ORPHAN if object is added and removed from collection
-------------------------------------------------------------------------------------------------------------------------
Key: HHH-5129
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5129
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: hibernate-core-3.3.2.GA
hibernate-annotations-3.4.0.GA
hibernate-entitymanager-3.4.0.GA
MySQL 5.1
mysql-connector-java-5.1.12
Reporter: José González Gómez
Attachments: hibernate-test-case.zip
I have a parent entity with a @OneToMany collection, with CascadeType.ALL and CascadeType.DELETE_ORPHAN. If I follow the following steps Hibernate throws a TransientObjectException:
1. Load the parent entity with its collection from database
2. Add a child entity to the collection
3. Add a second child entity to the collection
4. Remove the second child entity from the collection
5. Flush / commit the transaction
The bug cannot be reproduced if:
1. The parent entity is created in the same transaction where the rest of operations are made
2. All the added children are removed
The following is irrelevant for reproducing the bug:
1. The relationship may be unidirectional or bidirectional
I've attached a maven project with a test case with a trimmed down version of our production code showing the bug.
--
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
16 years
[Hibernate-JIRA] Created: (HHH-5127) Saving an entity in the postInsert of another entity results into SQLIntegrityConstraintViolationException
by Rupesh Kumar (JIRA)
Saving an entity in the postInsert of another entity results into SQLIntegrityConstraintViolationException
----------------------------------------------------------------------------------------------------------
Key: HHH-5127
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5127
Project: Hibernate Core
Issue Type: Bug
Components: core
Environment: Hibernate 3.3.2, SQLServer
Reporter: Rupesh Kumar
Attachments: hibernatetest.zip
When an entity is inserted in the postInsert event of another entity, the operation fails throwing constraint violation exception for User.
I have an entity User, which I try to save in UserMgr. There is also a post Insert event Listener added to the hibernate configuration. This listener adds an audit record whenever a new entity is inserted. The id for User is assigned whereas for Audit, it is autogenerated. The weird thing is user's Id is unique and there is no other user added with that id but it always throws a constraint violation exception.
Seeing the Hibernate source, I noticed that hibernate performs the insert batch operation and during the insert of 'User', it will call postInsert which tries to insert "Audit" which inserts in the same "insert" list. Since the id of Audit is auto-generated, the session needs to be flushed here again. At this point, hibernate tries to process the same insert list which it had processed earlier and thus throws a constraint violation exception since the user was already inserted in the first round.
The workaround seems to be that - if there is any insert/update/delete needs to happen in the event handler, it must happen in a separate session than the one firing the event.
--
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
16 years
[Hibernate-JIRA] Created: (HHH-5060) MappedSuperclass in the middle of class hierarchy - column not found
by bogdan (JIRA)
MappedSuperclass in the middle of class hierarchy - column not found
--------------------------------------------------------------------
Key: HHH-5060
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5060
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-CR-2
Reporter: bogdan
Attachments: mappedsuperclasstestcase.zip
We've got model with MappedSuperclass in the middle of class hierarchy:
Person(Entity) -> EmployeeBasic(MappedSuperclass) -> Employee(Entity) -> BossBasic(MappedSuperclass) -> Boss(Entity)
Following exception occurs when we run query: "SELECT p1 FROM Employee p1", which should return instances of Employee and Boss (attached: test.CMappedSuperclassTestCase.testSimpleQueryModel()):
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1167)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1100)
[...]
Caused by: java.sql.SQLException: Column not found: OWNED11_1_
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
Query against the same model works well when we eliminate MappedSuperclass from hierarchy (attached: test.CMappedSuperclassTestCase.testSimpleQueryModel2()).
Issue didn't occure in previous release: 3.3.2.GA.
--
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
16 years
[Hibernate-JIRA] Created: (HHH-5110) Detected JDK Version: 1.6.0-15 is not in the allowed range [1.5, 1.6).
by Michal Petrus (JIRA)
Detected JDK Version: 1.6.0-15 is not in the allowed range [1.5,1.6).
---------------------------------------------------------------------
Key: HHH-5110
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5110
Project: Hibernate Core
Issue Type: Bug
Components: build
Affects Versions: 3.5.0-Final
Environment: Linux version 2.6.31-20-generic, Ubuntu 4.4.1-4ubuntu8
Reporter: Michal Petrus
Priority: Trivial
The problem's appeared during hibernate-distribution-3.5.0-Final/project/tutorials/web compilation.
I am using:
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
1. unpack hibernate-distribution-3.5.0-Final-dist.tar.gz
2. go to ....hibernate-distribution-3.5.0-Final/project/tutorials/web
3. run mvn install
I got following error message:
Rule 0: org.apache.maven.plugin.enforcer.RequireJavaVersion failed with message: Detected JDK Version: 1.6.0-15 is not in the allowed range [1.5,1.6).
It is strange 'cause I am using right java version.
The only place checking java version is in ...hibernate-distribution-3.5.0-Final/project/parent/pom.xml
When I changed line 135
<version>[1.5,1.6)</version> to <version>[1.5,)</version>
it started working.
--
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
16 years