[Hibernate-JIRA] Created: (EJB-324) Deployed Maven POM incorrectly excludes transitive dependency
by Joe Germuska (JIRA)
Deployed Maven POM incorrectly excludes transitive dependency
-------------------------------------------------------------
Key: EJB-324
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-324
Project: Hibernate Entity Manager
Issue Type: Bug
Affects Versions: 3.3.1.GA
Environment: Maven 2
Reporter: Joe Germuska
Priority: Trivial
The deployed Maven POM for Hibernate Entity Manager 3.3.1.ga incorrectly excludes the dependency upon the oswego-concurrent libraries (see below). This leads to a NoClassDefFound error:
nested exception is java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap
Caused by:
java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap
at org.jboss.util.file.ArchiveBrowser.<clinit>(ArchiveBrowser.java:52)
I haven't yet determined how the Maven POMs are being managed by the Hibernate team, but they don't seem to be in Subversion; therefore, I've marked this trivial, although it is a little more than that for someone who is trying to use the Maven repository.
In any case, it should be easy to fix. More generally, it might be more correct to employ Maven's ranged version dependency syntax, instead of explicitly excluding other dependencies.
excerpt from http://repo1.maven.org/maven2/org/hibernate/hibernate-entitymanager/3.3.1...
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>2.0.4.GA</version>
<exclusions>
...
<exclusion>
<groupId>oswego-concurrent</groupId>
<artifactId>concurrent</artifactId>
</exclusion>
...
</exclusions>
</dependency>
--
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-2617) Warning on tables with inheritance when table defaults are set in entity-mappings
by Stephen Todd (JIRA)
Warning on tables with inheritance when table defaults are set in entity-mappings
---------------------------------------------------------------------------------
Key: HHH-2617
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2617
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.2
Environment: Using Annotations
Reporter: Stephen Todd
Priority: Trivial
Attachments: inheritance-orm.xml, TestSingleTableInheritanceWarnings.java
The following warning message is logged when entity-mapping defaults are set and tables with inheritance are present:
Illegal use of @Table in a subclass of a SINGLE_TABLE hierarchy: class.name.Here
I attached a test case that recreates the problem. Basically, the error occurs when a resource contains persistence-unit-defaults. It appears that hibernate creates an @Table attribute for every registered entity when I think it should only do it for non-single table inheritance entities. Below is an example of the orm.xml
<entity-mappings>
<persistence-unit-metadata>
<persistence-unit-defaults>
<catalog>public</catalog>
</persistence-unit-defaults>
</persistence-unit-metadata>
<entity class="hibernatebugs.TestAnnotationWarnings$ParentEntity">
<inheritance strategy="SINGLE_TABLE"/>
</entity>
</entity-mappings>
Test requires EasyMock and Log4J.
--
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-2073) many-to-one join fetch with optional parent causing stray query to fire
by Adam Hardy (JIRA)
many-to-one join fetch with optional parent causing stray query to fire
-----------------------------------------------------------------------
Key: HHH-2073
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2073
Project: Hibernate3
Type: Bug
Reporter: Adam Hardy
Priority: Minor
Attachments: bugtest.zip
I have a call centre application which uses a mature database and is therefore pushing Hibernate to accomplish the mappings I need. The issue here is extra queries that Hibernate is firing where I set up the mapping to do a join in one hit.
I am fetching child objects which may or may not have a parent. The child's foreign key points to a non-primary key on the parent. This is not reflected by a foreign key constraint in the database (hence it allows child to have no parent).
If the child object has the foreign key 0 instead of null, which is the protocol in this database, then the parent which doesn't exist is not (& cannot) be instantiated, no problem, but then after processing the resultset, Hibernate fires off another query to fetch the parent that it could not find data for in the first query.
This is obviously unnecessary in this context and degrades the performance on large searches on this child.
I have classified it as minor since I suspect there may be work-arounds but I have not researched that yet.
I didn't know whether I could put the mapping XML in the query, so I have attached a simplistic testcase example that demonstrates the problem.
The following forum messages are relevant and the latter contains the mappings, which is easier than extracting them out of the testcase zip:
http://forum.hibernate.org/viewtopic.php?t=960522
http://forum.hibernate.org/viewtopic.php?t=964211
--
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-2664) full join not working
by Fabio Tudone (JIRA)
full join not working
---------------------
Key: HHH-2664
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2664
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.4, 3.1.2
Environment: Any DB, tested on Windows
Reporter: Fabio Tudone
Attachments: test.jar
I get this error when trying to full join:
- an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: undefined join type 23
at org.hibernate.hql.ast.util.JoinProcessor.toHibernateJoinType(JoinProcessor.java:68)
at org.hibernate.hql.ast.HqlSqlWalker.setImpliedJoinType(HqlSqlWalker.java:433)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3157)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3067)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
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:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at com.finantix.test.Main.main(Main.java:63)
--
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-2996) Allow expression in a @JoinColumn for a composite foreign key
by Darren Bell (JIRA)
Allow expression in a @JoinColumn for a composite foreign key
-------------------------------------------------------------
Key: HHH-2996
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2996
Project: Hibernate3
Issue Type: New Feature
Affects Versions: 3.2.5
Environment: hibernate 3.2.5, db2/400 v5r4
Reporter: Darren Bell
I am mapping our Mapics COM history with hibernate and have been pretty successful so far, but have hit a stumbling block.
There is a table in Mapics that stores history comments for many different other tables, hence each table has a different foreign key.
The table is outlined below for those that don't know Mapics ;)
COL_NO NAME COL_TYPE LENGTH DP NULL DFT DEFAULT DESCRIPTION
1 GAAENB NUMERIC 2 0 N Y 0 Company number
2 GAGGNB NUMERIC 6 0 N Y 0 Invoice number
3 GAHYNB DECIMAL 7 0 N Y 0 Invoice sequence
4 GAKBNB DECIMAL 5 0 N Y 0 Comment line sequence number
5 GAAKCD CHAR 3 N Y ' ' Language code
6 GAAAD9 CHAR 1 N Y ' ' Internal print only?
7 GAHDTX CHAR 25 N Y ' ' Comment line text
8 GAHXCD CHAR 5 N Y ' ' Comment user reference
9 GADCCD CHAR 1 N Y ' ' Internal header type
10 GACVNB CHAR 7 N Y ' ' Quote/order number
11 GAK4NB DECIMAL 7 0 N Y 0 Shipment header number
12 GAAFAD DECIMAL 3 0 N Y 0 Shipment consolidate seq
13 GALCNB DECIMAL 7 0 N Y 0 Ship release sequence
14 GAAASZ DECIMAL 5 0 N Y 0 Kit release sequence
15 GAAAD2 DECIMAL 7 0 N Y 0 Special charge sequence #
16 GAAD1N CHAR 1 N Y ' ' Text line print control
To get the comments from the shipment release we use the following:
@OneToMany()
@JoinColumns ({
@JoinColumn(name=HistoricalComment.Columns.COMPANY_NUMBER, referencedColumnName=ShipRelease.Columns.COMPANY_NUMBER),
@JoinColumn(name=HistoricalComment.Columns.INTERNAL_HEADER_TYPE, referencedColumnName=ShipRelease.Columns.INTERNAL_HEADER_TYPE),
@JoinColumn(name=HistoricalComment.Columns.ORDER_NUMBER, referencedColumnName=ShipRelease.Columns.ORDER_NUMBER),
@JoinColumn(name=HistoricalComment.Columns.SHIPMENT_HEADER_NUMBER, referencedColumnName=ShipRelease.Columns.SHIPMENT_HEADER_NUMBER),
@JoinColumn(name=HistoricalComment.Columns.SHIP_RELEASE_SEQUENCE, referencedColumnName=ShipRelease.Columns.SHIP_RELEASE_SEQUENCE),
@JoinColumn(name=HistoricalComment.Columns.KIT_RELEASE_SEQUENCE, referencedColumnName=ShipRelease.Columns.KIT_RELEASE_SEQUENCE)
})
@Sort(type=SortType.NATURAL)
private SortedSet<HistoricalComment> historicalComments;
Which works well, but to the the comments for the ship header the following is needed
@OneToMany()
@JoinColumns ({
@JoinColumn(name=HistoricalComment.Columns.COMPANY_NUMBER, referencedColumnName=ShipHeader.Columns.COMPANY_NUMBER),
@JoinColumn(name=HistoricalComment.Columns.INTERNAL_HEADER_TYPE, referencedColumnName=ShipHeader.Columns.INTERNAL_HEADER_TYPE),
@JoinColumn(name=HistoricalComment.Columns.ORDER_NUMBER, referencedColumnName=ShipHeader.Columns.ORDER_NUMBER),
@JoinColumn(name=HistoricalComment.Columns.SHIPMENT_HEADER_NUMBER, referencedColumnName=ShipHeader.Columns.SHIPMENT_HEADER_NUMBER)
})
@Sort(type=SortType.NATURAL)
private SortedSet<HistoricalComment> historicalComments;
As you can see there are two keys missing on the second one to many. This has the undesired effect of retriving all the comments for the entire shipment, whether they are related to a relase, the header itself, or charge codes.
Now, what i'm suggesting is to allow an expression for one of the join colums. The following would solve the problem.
@OneToMany()
@JoinColumns ({
@JoinColumn(name=HistoricalComment.Columns.COMPANY_NUMBER, referencedColumnName=ShipRelease.Columns.COMPANY_NUMBER),
@JoinColumn(name=HistoricalComment.Columns.INTERNAL_HEADER_TYPE, referencedColumnName=ShipRelease.Columns.INTERNAL_HEADER_TYPE),
@JoinColumn(name=HistoricalComment.Columns.ORDER_NUMBER, referencedColumnName=ShipRelease.Columns.ORDER_NUMBER),
@JoinColumn(name=HistoricalComment.Columns.SHIPMENT_HEADER_NUMBER, referencedColumnName=ShipRelease.Columns.SHIPMENT_HEADER_NUMBER),
@JoinColumn(name=HistoricalComment.Columns.SHIP_RELEASE_SEQUENCE, expression=":shipReleaseSequence > 0"),
@JoinColumn(name=HistoricalComment.Columns.KIT_RELEASE_SEQUENCE, expression=":kitReleaseSequence = 0")
})
This would put the expressions into the join clause.
What do you think? Have i explained this well enough?
--
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-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-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