[Hibernate-JIRA] Created: (ANN-653) Exception when unidirection OneToMany relation defined in Embeded class
by Jifeng Liu (JIRA)
Exception when unidirection OneToMany relation defined in Embeded class
-----------------------------------------------------------------------
Key: ANN-653
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-653
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.0.ga
Environment: Hibernate Core 3.2.5.ga
Hibernate Annotations 3.3.0 GA
Hibernate EntityManager 3.3.1 GA
Reporter: Jifeng Liu
Attachments: src.zip
I got the following exception when I run the test case in attach file. It seems Hibernate throws Exception when unidirection OneToMany relation defined in Embeded class.
Exception in thread "main" org.hibernate.AnnotationException: Illegal attempt to define a @JoinColumn with a mappedBy as
sociation: htmlText.images
at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumn(Ejb3JoinColumn.java:152)
at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumns(Ejb3JoinColumn.java:127)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1178)
at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:1731)
at org.hibernate.cfg.AnnotationBinder.bindComponent(AnnotationBinder.java:1665)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1544)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:733)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:706)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:137)
at test.Test.run(Test.java:24)
at test.Test.main(Test.java: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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 1 month
[Hibernate-JIRA] Created: (EJB-330) Calling configure(String) on Ejb3Configuration before addAnnotatedClass(..) breaks callbacks
by Tuure Laurinolli (JIRA)
Calling configure(String) on Ejb3Configuration before addAnnotatedClass(..) breaks callbacks
--------------------------------------------------------------------------------------------
Key: EJB-330
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-330
Project: Hibernate Entity Manager
Issue Type: Bug
Components: Documentation, EntityManager
Affects Versions: 3.3.1.GA
Environment: Hibernate Core 3.2.5, Hibernate Annotations 3.3.0, Hibernate EntityManager 3.3.1
Reporter: Tuure Laurinolli
Attachments: cbtest.tar.gz
If configure(String) has been called on Ejb3Configuration before adding more @Entity-annotated classes with addAnnotatedClass, the @PostLoad callbacks of the classes added with addAnnotatedClass do not work. If the class is added with addAnnotatedClass before configure(String) is called, the callbacks work as expected.
The documentation at http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/configu... shows a listing where configure(String) is called before addAnnotatedClass, which in my more minimal test case results in the callbacks on the added class not being called.
The attached test case extracts a directory cbtest with the following files in it: test.xml, test.sh, test/Something.java and test/Test.java. test.sh compiled and runs the test, provided that necessary jars have been copied to cbtest.
The necessary jars are from Hibernate Core 3.2.5, Hibernate Annotations 3.3.0 and Hibernate EntityManager 3.3.1, except for hsqldb.jar, which is needed because the configuration in test.xml expects Hsqldb.
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (EJB-295) mapping-file orm.xml not included
by Georges-Etienne Legendre (JIRA)
mapping-file orm.xml not included
---------------------------------
Key: EJB-295
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-295
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Environment: Hibernate Core 3.2.4.GA
Hibernate EntityManager 3.3.1.GA
Reporter: Georges-Etienne Legendre
We have the following situation: A jar library for our entity classes has been created. In it, there are these two files in the META-INF directory: persistence.xml and orm.xml. We define some common queries in the orm.xml file.
This library is then used in another project. Because we would like to define other more specialized named queries in this project, we assumed that another orm.xml file (in the META-INF directoty) could be used. Without any workaround, it doesn't work. The entity manager only find/use the orm.xml contained in the library. To make it works, we have to add these 2 lines in the persistence.xml :
<mapping-file>/META-INF/orm.xml</mapping-file>
<mapping-file>/META-INF/orm.xml</mapping-file>
The entity manager then includes both orm.xml files.
In JSR 220, chapter 6.2.1.6, it's said: "... A object/relational mapping XML file named orm.xml may be specified in the META-INF directory in the root of the persistence unit or in the META-INF directory of any jar file referenced by the persistence. xml. Alternatively, or in addition, other mapping files may be referenced by the mapping-file elements of the persistence-unit element, and may be present anywhere on the class path."
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (EJB-333) Space in path result in error during deployment in JBoss AS
by Lukasz Hall (JIRA)
Space in path result in error during deployment in JBoss AS
-----------------------------------------------------------
Key: EJB-333
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-333
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.2.Beta3
Environment: WinXP
Reporter: Lukasz Hall
The space issue appears to still be present in the latest release.
Using the latest build (EntityManager 3.3.2Beta3, run against JBoss 4.2.0), the relevant portions of the stack trace are:
java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/Program Files/JBoss/lh3_d_jb_420/jboss-as/server/production/tmp/deploy/tmp31846Archive-PerformanceTestDriver.sar-contents/Archive-PerformanceTestData.jar
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:616)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:359)
....
Caused by: java.lang.IllegalArgumentException: Unable to visit JAR file:/C:/Program Files/JBoss/lh3_d_jb_420/jboss-as/server/production/tmp/deploy/tmp31846Archive-PerformanceTestDriver.sar-contents/Archive-PerformanceTestData.jar. Cause: Illegal character in path at index 16: file:/C:/Program Files/JBoss/lh3_d_jb_420/jboss-as/server/production/tmp/deploy/tmp31846Archive-PerformanceTestDriver.sar-contents/Archive-PerformanceTestData.jar
at org.hibernate.ejb.packaging.JarVisitorFactory.getVisitor(JarVisitorFactory.java:113)
....
Caused by: java.net.URISyntaxException: Illegal character in path at index 16: file:/C:/Program Files/JBoss/lh3_d_jb_420/jboss-as/server/production/tmp/deploy/tmp31846Archive-PerformanceTestDriver.sar-contents/Archive-PerformanceTestData.jar
at java.net.URI$Parser.fail(URI.java:2816)
at java.net.URI$Parser.checkChars(URI.java:2989)
at java.net.URI$Parser.parseHierarchical(URI.java:3073)
at java.net.URI$Parser.parse(URI.java:3021)
at java.net.URI.<init>(URI.java:578)
at java.net.URL.toURI(URL.java:916)
at org.hibernate.ejb.packaging.JarVisitorFactory.getVisitor(JarVisitorFactory.java:110)
.....
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (ANN-650) Explicitly disallow @Version on @Embedded and throw meaningful Exception
by Chris Bredesen (JIRA)
Explicitly disallow @Version on @Embedded and throw meaningful Exception
------------------------------------------------------------------------
Key: ANN-650
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-650
Project: Hibernate Annotations
Issue Type: Improvement
Components: binder
Affects Versions: 3.3.0.ga
Environment: Hibernate Annotations 3.3.0.GA
Hibernate 3.2.2
Hibernate EntityManager 3.3.1.GA
Reporter: Chris Bredesen
Priority: Minor
The above situation should be explicitly checked for and a meaningful exception thrown. Currently, this configuration blows up with the following trace:
java.lang.ArrayIndexOutOfBoundsException: -66
at org.hibernate.persister.entity.AbstractEntityPersister.checkVersion(AbstractEntityPersister.java:1855)
at org.hibernate.persister.entity.AbstractEntityPersister.generateUpdateString(AbstractEntityPersister.java:1811)
at org.hibernate.persister.entity.AbstractEntityPersister.generateUpdateString(AbstractEntityPersister.java:1777)
at org.hibernate.persister.entity.AbstractEntityPersister.postConstruct(AbstractEntityPersister.java:2930)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:409)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-3114) Subqueries in Criteria-API use wrong table alias
by Gerald Glocker (JIRA)
Subqueries in Criteria-API use wrong table alias
------------------------------------------------
Key: HHH-3114
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3114
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.6
Reporter: Gerald Glocker
Priority: Blocker
Subqueries (exists, notExists, and probably others) are formulated using table alias "this_" but the outer query also uses the same table alias.
This is a serious mistake for subqueries working on the same table or for subqueries on tables with the same column names.
Example:
DetachedCriteria c = DetachedCriteria.forClass(Person.class, "a");
c.add(Restrictions.eq("lastname", "Smith"));
DetachedCriteria sub = DetachedCriteria.forClass(Person.class);
sub.setProjection(Projections.property("id"));
sub.add(Restrictions.eqProperty("lastname", "a.lastname"));
sub.add(Restrictions.gtProperty("dob", "a.dob"));
c.add(Subqueries.exists(sub));
List persons = ht.findByCriteria(c);
Produces SQL:
select this_.id as id4_0_,
this_.firstname as firstname4_0_,
this_.lastname as lastname4_0_,
this_.dob as dob4_0_
from Person this_
where this_.lastname = ?
and exists (select this_.id as y0_
from Person this_
where this_.lastname = this_.lastname
and this_.dob > this_.dob)
The error can cleary be seen on the where-condition "this_.dob > this_.dob".
Please try to fix this problem soon. A running test could be provided.
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (ANN-673) Guaranty column order in genereted schema
by Ivo Danihelka (JIRA)
Guaranty column order in genereted schema
-----------------------------------------
Key: ANN-673
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-673
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.2.1, 3.3.1
Environment: Hibernate 3.2.1 and SVN, PostgreSQL 8.1
Reporter: Ivo Danihelka
Priority: Minor
Attachments: fk-order.path
Problem:
- AnnotationConfiguration does not define stable ordering for foreign key columns. They then could appear in generated SQL schema in any order. For example, sometimes table foreign key column person_id is before another foreign key column dog_id and sometimes it is behind it.
Tool hbm2ddl could be used to see the generated schema. The order of foreign key columns in one table changes
when unrelated change is made inside mapping of a different table.
Proposed Solution:
- Don't base the ordering of foreign keys on hashCode. Base it on tableName+propertyName.
A patch against hibernate 3.2.1 is attached (it also backportes #ANN-551 into 3.2.1).
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (ANN-591) SchemaExport throws ConcurrentModificationException for entity containing list of lists
by Ivan O'Connor (JIRA)
SchemaExport throws ConcurrentModificationException for entity containing list of lists
---------------------------------------------------------------------------------------
Key: ANN-591
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-591
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.2.1
Environment: Hibernate 3.2.1.GA, Oracle 10
Reporter: Ivan O'Connor
Attachments: hbm2ddl.zip
I have a class, let's call it A, that contains a List of class B. Each instance of B has a List of class C. I'm trying to generate the DDL for this, so I've annotated the code and run it through SchemaExport, which throws a ConcurrentModificationException. My environment: Java 1.5, Oracle 10, Hibernate 3.2.1ga.
The problem seems to be caused by having an entity (A) containing an embedded collection (of B), each element of which contains a collection (of C). SchemaExport generates correct DDL when the annotations are modified to make B and/or C an entity, but not when they are both components. I realise this is considered something of an exotic case, but I'd like to know why the DDL doesn't generate.
See bugReport.txt in attached zip for further details.
--
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
18 years, 1 month