[Hibernate-JIRA] Created: (HHH-3168) 3.2.6 breaks querying by a property of an entity in a collection
by Michael Newcomb (JIRA)
3.2.6 breaks querying by a property of an entity in a collection
----------------------------------------------------------------
Key: HHH-3168
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3168
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.6
Reporter: Michael Newcomb
@NamedQuery(name="q", query="select a from A a where a.stuff.name=:name")
class A
{
@ManyToMany
@MapKey(name = "name")
@Sort(type = SortType.NATURAL)
SortedMap<String, C> stuff;
}
class B
{
@Basic
String name;
}
class C
extends B
{
}
Please excuse the brevity of the example (code is not on internet accessible machine), but just dropping in 3.2.6 hibernate3.jar causes an error in DotNode.propertyType is set to the type of 'name' and fails all the checks in resolve() and calls checkLhsIsNotCollection() which fails...
When looking at the logs...
3.2.5:
[DotNode] dereferenceCollection(): Created...
[FromReferenceNode] Resolved : a.stuff -> .
[DotNode] getDataType() : name -> ...StringType
[FromReferenceNode] Resolved : a.stuff.name -> xxx.name
[HqlSqlBaseWalker] select : finishing up...
- at this point there is some logs about 'Using FROM fragment' and then it prints another AST tree with something about querySpaces...
- then it starts to check the next query
3.2.6:
[DotNode] dereferenceCollection(): Created...
[FromReferenceNode] Resolved : a.stuff -> .
[DotNode] getDataType() : name -> ...StringType
- then it starts to check the next query
- it is missing all the extra stuff after the 'getDataType() : name -> ...StringType'
--
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, 9 months
[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
16 years, 9 months
[Hibernate-JIRA] Commented: (HHH-951) setMaxResults causes "ORA-00918: column ambiguously defined" exception
by Rob Harrington (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-951?page=co... ]
Rob Harrington commented on HHH-951:
------------------------------------
I resolved this on my end. Turned out i had a direct property reference (lineItem.insertionOrderId) and an indirect reference to essentially the same thing (lineItem.insertionOrder.id) on the same object (lineItem). The mapping for my LineItem class included both, needlessly. Is not a problem in 3.0.5. Not sure if it should have been or if it shouldn't be resulting in the same alias, but in any case not a major issue.
> setMaxResults causes "ORA-00918: column ambiguously defined" exception
> -----------------------------------------------------------------------
>
> Key: HHH-951
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-951
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5, 3.1 beta 2
> Environment: hibernate3.0.5, hibernate3.1b2, Oracle 9
> Reporter: Karel Sommer
>
> when create criteria with associations, i get this error:
> ORA-00918: column ambiguously defined
> mapping:
> <class name="User" table="FRAME_USER" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_user_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="user_name" type="string" not-null="true"/>
> <property name="blocked" type="yes_no" not-null="true"/>
> <property name="access_logon" type="timestamp"/>
> <property name="denied_logon" type="timestamp"/>
> <property name="inactivity_time" type="long"/>
> <property name="session_count" type="long"/>
> <idbag name="terminalGroups" table="FRAME_USER_TERMINAL" fetch="join" outer-join="true">
> <collection-id column="ID" type="long">
> <generator class="sequence">
> <param name="sequence">frame_user_terminal_seq</param>
> </generator>
> </collection-id>
> <key column="id_user"/>
> <many-to-many column="id_terminal_groups" class="TerminalGroup" fetch="join" outer-join="true"/>
> </idbag>
> </class>
> <class name="TerminalGroup" table="FRAME_TERMINAL_GROUPS" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_terminal_groups_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="name" column="group_name" type="string" not-null="true"/>
> <idbag name="terminals" table="FRAME_TERMINAL_REL" fetch="join" outer-join="true">
> <collection-id column="ID" type="long" >
> <generator class="sequence">
> <param name="sequence">frame_terminal_rel_seq</param>
> </generator>
> </collection-id>
> <key column="id_term_group"/>
> <many-to-many column="id_term" class="Terminal" fetch="join" outer-join="true"/>
> </idbag>
> </class>
> <class name="Terminal" table="FRAME_TERMINAL" where="status != 'D'" dynamic-update="true" dynamic-insert="true">
> <id name="id" type="long" unsaved-value="null">
> <column name="ID" not-null="true"/>
> <generator class="sequence">
> <param name="sequence">frame_terminal_seq</param>
> </generator>
> </id>
> <version type="timestamp" column="stamp" name="timestamp" unsaved-value="null"/>
> <property name="status" type="char" not-null="true"/>
> <property name="mac" type="string" not-null="true"/>
> <property name="name" column="ident" type="string" not-null="true"/>
> <property name="description" type="string"/>
> code:
> session.createCriteria(User.class)
> .add(Restrictions.like("user_name", "%")
> .createCriteria("terminalGroups")
> .add( Restrictions.like("group_name", "%").
> .setProjection(Projections.rowCount())
> .uniqueResult();
--
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, 9 months
[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
16 years, 9 months
[Hibernate-JIRA] Commented: (HHH-1276) Add outer join support to Criteria API
by Paul Kist (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1276?page=c... ]
Paul Kist commented on HHH-1276:
--------------------------------
Has this patch been applied to 3.2.5ga? We're trying to use the following method for left outer joins:
Criteria myCriteria = session.createCriteria(Employee.class);
LogicalExpression orExp = Expression.or(Expression.like("name", "%"+queryString.trim()+"%"), Expression.like("nickname", "%"+queryString.trim()+"%"));
LogicalExpression orExp2 = Expression.or(Expression.like("company.company_name", "%"+queryString.trim()+"%"),Expression.eq("id", id));
myCriteria.setFetchMode("company", FetchMode.JOIN).add(Expression.or(orExp, orExp2));
But running the .list() generates an exception:
Time elapse
d: 0.05 sec <<< ERROR!
org.hibernate.QueryException: could not resolve property: company.company_name
of: my.model.Employee
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyExcept
ion(AbstractPropertyMapping.java:44)
> Add outer join support to Criteria API
> --------------------------------------
>
> Key: HHH-1276
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1276
> Project: Hibernate3
> Issue Type: Patch
> Components: core
> Affects Versions: 3.1
> Reporter: Jeremy Haile
> Attachments: patch.txt
>
>
> Here's a patch that allows users to specify a joinType when calling createCriteria and createAlias on the Criteria interface. This allows you to specify outer joins when creating Criteria. If you have any questions or see anything I missed - let me know. I have tested and am currently using the patch with no problems.
--
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, 9 months
[Hibernate-JIRA] Commented: (HHH-1804) Empty 'FetchingScrollableResultsImpl' throws SQLException
by Sadykov Bulgar (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804?page=c... ]
Sadykov Bulgar commented on HHH-1804:
-------------------------------------
Can I somehow use this patch without recompiling hibernate jar ? Or is there workarounds that I can use without recompiling hibernate jar ?
> Empty 'FetchingScrollableResultsImpl' throws SQLException
> ---------------------------------------------------------
>
> Key: HHH-1804
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804
> Project: Hibernate3
> Issue Type: Bug
> Reporter: Maarten Winkels
> Attachments: EmptyFetchJoinScrollTest.java, scroll-join-fetch-empty.patch
>
>
> When scrolling a HQL query with join fetch on a collection, that doesn't return any results, the following execption occurs:
> org.hibernate.exception.GenericJDBCException: could not perform sequential read of results (forward)
> at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:386)
> at org.hibernate.impl.FetchingScrollableResultsImpl.next(FetchingScrollableResultsImpl.java:55)
> at org.hibernate.test.joinfetch.EmptyFetchJoinScrollTest.testFetchJoinEmptyScroll(EmptyFetchJoinScrollTest.java:21)
> 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:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at org.hibernate.test.TestCase.runTest(TestCase.java:161)
> 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)
> Caused by: java.sql.SQLException: No data is available
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.checkAvailable(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getColumnInType(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hibernate.type.StringType.get(StringType.java:18)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
> at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:375)
> ... 18 more
--
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, 9 months
[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
16 years, 10 months