You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
(175) |
Jul
(209) |
Aug
(302) |
Sep
(287) |
Oct
(339) |
Nov
(314) |
Dec
(329) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(479) |
Feb
(389) |
Mar
(599) |
Apr
(307) |
May
(390) |
Jun
(300) |
Jul
(410) |
Aug
(458) |
Sep
(299) |
Oct
(315) |
Nov
(363) |
Dec
(529) |
2005 |
Jan
(568) |
Feb
(434) |
Mar
(1004) |
Apr
(823) |
May
(767) |
Jun
(763) |
Jul
(854) |
Aug
(862) |
Sep
(560) |
Oct
(853) |
Nov
(763) |
Dec
(731) |
2006 |
Jan
(776) |
Feb
(608) |
Mar
(657) |
Apr
(424) |
May
(559) |
Jun
(440) |
Jul
(448) |
Aug
(58) |
Sep
|
Oct
(17) |
Nov
(16) |
Dec
(8) |
2007 |
Jan
(1) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
(3) |
Jun
(3) |
Jul
(3) |
Aug
(16) |
Sep
(10) |
Oct
(4) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Steve E. (JIRA) <no...@at...> - 2006-06-15 05:33:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1837?page=comments#action_23341 ] Steve Ebersole commented on HHH-1837: ------------------------------------- Not to mention it is already discussed in the doco: http://www.hibernate.org/hib_docs/v3/reference/en/html/queryhql.html#queryhql-joins-forms > discussion: implicit joins are always INNER > ------------------------------------------- > > Key: HHH-1837 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1837 > Project: Hibernate3 > Type: Improvement > Reporter: Bill Schneider > > > It would be helpful to explain the consequences in the docs re. implicit joins always resulting in INNER joins. > This causes semantics of HQL expressions to be quite different from similar-looking JSTL expressions. > in particular consider (copied from comment on HHH-989) this HQL expression > "cat.mate.name= ? OR cat.name=?" > if cat.mate is null, this will not return any results, **even if** the right hand cat.name=? expression matches. > A similar condition in JSTL (<c:if test="${cat.mate.name = ... || cat.name = ...}">) would behave differently. > The HQL behavior may be correct, but sure could be confusing at first. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-06-15 00:26:34
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1632?page=all ] Emmanuel Bernard reopened HHH-1632: ----------------------------------- > Problem using Expression.isNull and Expression.isNotNull in a Criteria with an entity with a composite id. > ---------------------------------------------------------------------------------------------------------- > > Key: HHH-1632 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1632 > Project: Hibernate3 > Type: Bug > Components: query-criteria > Versions: 3.1.3 > Environment: Hibernate 3.1.3, DB2 > Reporter: Jean-Francois Lagace > Priority: Blocker > Attachments: NullAndNotNullExpressionPatch.txt > > > I have found a problem using Expression.isNull and Expression.isNotNull in a Criteria with composite primary keys. > We have the following 2 tables: > Table1 have a primary key composed of column A and column C. > Table2 have a primary key composed of column B and column C. And it has also a foreign key from Table1 (column A and C). The column C has always the same value in Table1 and Table2, so it's not repeated twice in Table2 (for the foreign key). So the Table2 has 3 columns: B, C and A. > When using Criteria to select every row from Table2 for which the link to Table1 is null, I write the following code: > Criteria criteria = session.createCriteria(Table2.class); > criteria.add(Expression.isNull("table1")); > List<Table2> list = criteria.list(); > The generated SQL looks like this: > select * from Table2 where (A is null and C is null) > This request returns all rows from Table2 because the column C is never null. I think the where clause should have been written using an OR instead of an AND. If one column of the foreign key is null, the link with Table1 should be considered as null. > And there is the same problem with the isNotNull expression too. But in that case, the where clause is written using an OR instead of an AND. > To fixed those problems, I replaced the OR by an AND in the toSqlString method of the class org.hibernate.criterion.NotNullExpression. I did the same in the class org.hibernate.criterion.NullExpression, replacing the AND by an OR. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-06-15 00:26:32
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1632?page=all ] Emmanuel Bernard resolved HHH-1632: ----------------------------------- Resolution: Rejected > Problem using Expression.isNull and Expression.isNotNull in a Criteria with an entity with a composite id. > ---------------------------------------------------------------------------------------------------------- > > Key: HHH-1632 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1632 > Project: Hibernate3 > Type: Bug > Components: query-criteria > Versions: 3.1.3 > Environment: Hibernate 3.1.3, DB2 > Reporter: Jean-Francois Lagace > Priority: Blocker > Attachments: NullAndNotNullExpressionPatch.txt > > > I have found a problem using Expression.isNull and Expression.isNotNull in a Criteria with composite primary keys. > We have the following 2 tables: > Table1 have a primary key composed of column A and column C. > Table2 have a primary key composed of column B and column C. And it has also a foreign key from Table1 (column A and C). The column C has always the same value in Table1 and Table2, so it's not repeated twice in Table2 (for the foreign key). So the Table2 has 3 columns: B, C and A. > When using Criteria to select every row from Table2 for which the link to Table1 is null, I write the following code: > Criteria criteria = session.createCriteria(Table2.class); > criteria.add(Expression.isNull("table1")); > List<Table2> list = criteria.list(); > The generated SQL looks like this: > select * from Table2 where (A is null and C is null) > This request returns all rows from Table2 because the column C is never null. I think the where clause should have been written using an OR instead of an AND. If one column of the foreign key is null, the link with Table1 should be considered as null. > And there is the same problem with the isNotNull expression too. But in that case, the where clause is written using an OR instead of an AND. > To fixed those problems, I replaced the OR by an AND in the toSqlString method of the class org.hibernate.criterion.NotNullExpression. I did the same in the class org.hibernate.criterion.NullExpression, replacing the AND by an OR. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-06-15 00:24:39
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1632?page=all ] Emmanuel Bernard resolved HHH-1632: ----------------------------------- Resolution: Fixed Discussed with Francois, The proper solution is to implement your own Criterion and use it. Criteria API is extensible, don't hesitate to write you own criterions > Problem using Expression.isNull and Expression.isNotNull in a Criteria with an entity with a composite id. > ---------------------------------------------------------------------------------------------------------- > > Key: HHH-1632 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1632 > Project: Hibernate3 > Type: Bug > Components: query-criteria > Versions: 3.1.3 > Environment: Hibernate 3.1.3, DB2 > Reporter: Jean-Francois Lagace > Priority: Blocker > Attachments: NullAndNotNullExpressionPatch.txt > > > I have found a problem using Expression.isNull and Expression.isNotNull in a Criteria with composite primary keys. > We have the following 2 tables: > Table1 have a primary key composed of column A and column C. > Table2 have a primary key composed of column B and column C. And it has also a foreign key from Table1 (column A and C). The column C has always the same value in Table1 and Table2, so it's not repeated twice in Table2 (for the foreign key). So the Table2 has 3 columns: B, C and A. > When using Criteria to select every row from Table2 for which the link to Table1 is null, I write the following code: > Criteria criteria = session.createCriteria(Table2.class); > criteria.add(Expression.isNull("table1")); > List<Table2> list = criteria.list(); > The generated SQL looks like this: > select * from Table2 where (A is null and C is null) > This request returns all rows from Table2 because the column C is never null. I think the where clause should have been written using an OR instead of an AND. If one column of the foreign key is null, the link with Table1 should be considered as null. > And there is the same problem with the isNotNull expression too. But in that case, the where clause is written using an OR instead of an AND. > To fixed those problems, I replaced the OR by an AND in the toSqlString method of the class org.hibernate.criterion.NotNullExpression. I did the same in the class org.hibernate.criterion.NullExpression, replacing the AND by an OR. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Henrique S. (JIRA) <no...@at...> - 2006-06-14 19:36:39
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-511?page=comments#action_23339 ] Henrique Sousa commented on HHH-511: ------------------------------------ For EJB 3.0 this is failing due to a listener and and clear() is not called for the EntityManager. We must track changes to an entity, so in the pre-update callback we store a copy of the current entity and refresh it to get the old values. When I restore the updated state and let the flush() process continue this exception is raised. I cannot evict() the parent object because it still has to be saved and there is no such method in EntityManager. > reattach object from same session > --------------------------------- > > Key: HHH-511 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-511 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Gavin King > Priority: Minor > > > http://forum.hibernate.org/viewtopic.php?p=2231400#2231400 > There is a problem when you reattach a collection to the same session that it was previously attached to, after calling clear(). Hibernate checks the collections session reference, at reattach and concludes it is already attached. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Bill S. (JIRA) <no...@at...> - 2006-06-14 17:00:38
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1837?page=comments#action_23338 ] Bill Schneider commented on HHH-1837: ------------------------------------- This is really a request for documentation. I agree the HQL behavior is correct. The only issue is that, because the implicit-join syntax looks deceptively similar to something you could have in JSTL-EL, the SQL inner-join behavior is not immediately obvious to someone looking at this as a Java developer. So I think it would be helpful to just include a blurb to the effect of the above in the section in the hibernate reference on HQL implicit joins. > discussion: implicit joins are always INNER > ------------------------------------------- > > Key: HHH-1837 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1837 > Project: Hibernate3 > Type: Improvement > Reporter: Bill Schneider > > > It would be helpful to explain the consequences in the docs re. implicit joins always resulting in INNER joins. > This causes semantics of HQL expressions to be quite different from similar-looking JSTL expressions. > in particular consider (copied from comment on HHH-989) this HQL expression > "cat.mate.name= ? OR cat.name=?" > if cat.mate is null, this will not return any results, **even if** the right hand cat.name=? expression matches. > A similar condition in JSTL (<c:if test="${cat.mate.name = ... || cat.name = ...}">) would behave differently. > The HQL behavior may be correct, but sure could be confusing at first. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: John H. (JIRA) <no...@at...> - 2006-06-14 16:44:43
|
Wrong SQL generated for hql query on "any" relation --------------------------------------------------- Key: HHH-1838 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1838 Project: Hibernate3 Type: Bug Components: query-hql Versions: 3.2.0.alpha2, 3.1.3 Environment: Hibernate 3, PostgreSQL 8.0.3 Reporter: John Hughes Priority: Blocker Attachments: bug.jar Very easy to reproduce; an hql query like this: HibernateUtil.currentSession() .createQuery("from Container c where c.interf.class = 'Implementer'\ and interf = :i") .setParameter("i", interf) .list().iterator(); on a mapping like this: <hibernate-mapping default-access="field"> <class name="Container" table="Container"> <id name="hibernateId" column="container_id"> <generator class="native"/> </id> <any name="interf" meta-type="string" id-type="long"> <column name="interf_type"/> <column name="interf_id"/> </any> </class> </hibernate-mapping> produces an error like this: 12:34:21,335 INFO LongType:91 - could not bind value '16' to parameter: 2; The\ column index is out of range: 2, number of columns: 1. 12:34:21,349 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState: 22023 12:34:21,353 ERROR JDBCExceptionReporter:72 - The column index is out of range:\ 2, number of columns: 1. Exception in thread "main" org.hibernate.exception.DataException: could not exe\ cute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.\ java:77) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHel\ per.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2148) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029) at org.hibernate.loader.Loader.list(Loader.java:2024) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.j\ ava:333) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.jav\ a:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1123) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at Test.create(Test.java:41) at Test.main(Test.java:11) Caused by: org.postgresql.util.PSQLException: The column index is out of range\ : 2, number of columns: 1. at org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.\ java:38) at org.postgresql.core.v3.SimpleParameterList.setLiteralParameter(Simpl\ eParameterList.java:68) at org.postgresql.jdbc2.AbstractJdbc2Statement.bindLiteral(AbstractJdbc\ 2Statement.java:2046) at org.postgresql.jdbc2.AbstractJdbc2Statement.setLong(AbstractJdbc2Sta\ tement.java:1088) at org.hibernate.type.LongType.set(LongType.java:42) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65) at org.hibernate.type.AnyType.nullSafeSet(AnyType.java:139) at org.hibernate.type.AnyType.nullSafeSet(AnyType.java:117) at org.hibernate.loader.hql.QueryLoader.bindNamedParameters(QueryLoader\ .java:515) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577) at org.hibernate.loader.Loader.doQuery(Loader.java:661) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(L\ oader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2145) ... 9 more The generated SQL is this: select container0_.container_id as container1_0_, container0_.interf_type as interf2_0_, container0_.interf_id as interf3_0_ from Container container0_ where container0_.interf_type='Implementer' and (container0_.interf_type, container0_.interf_id)=? I'm attaching a small jar file which reproduces the error. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-06-14 16:37:47
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1837?page=all ] Max Rydahl Andersen closed HHH-1837: ------------------------------------ Resolution: Rejected HQL mimics SQL's ternary logic. JSTL and most other imperative languages only have binary logic. Two very different things. > discussion: implicit joins are always INNER > ------------------------------------------- > > Key: HHH-1837 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1837 > Project: Hibernate3 > Type: Improvement > Reporter: Bill Schneider > > > It would be helpful to explain the consequences in the docs re. implicit joins always resulting in INNER joins. > This causes semantics of HQL expressions to be quite different from similar-looking JSTL expressions. > in particular consider (copied from comment on HHH-989) this HQL expression > "cat.mate.name= ? OR cat.name=?" > if cat.mate is null, this will not return any results, **even if** the right hand cat.name=? expression matches. > A similar condition in JSTL (<c:if test="${cat.mate.name = ... || cat.name = ...}">) would behave differently. > The HQL behavior may be correct, but sure could be confusing at first. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Todd O (JIRA) <no...@at...> - 2006-06-14 15:45:35
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-374?page=all ] Todd O updated ANN-374: ----------------------- Attachment: KeyValue2.java MyEntity2.java TestKeyValue2.java > Map - OneToMany w or w/o join table creates bad sql > --------------------------------------------------- > > Key: ANN-374 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-374 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Versions: 3.1beta6 > Environment: Hibernate 3.1 RC1, Annotations 3.1b6, Java 1.5.0_05 > Reporter: Todd O > Assignee: Emmanuel Bernard > Fix For: 3.2.0.cr1 > Attachments: KeyValue2.java, MyEntity2.java, TestKeyValue2.java > > > Seems like there is a problem with mapping a Map using join table. > I have a relation like this: > @OneToMany(cascade=CascadeType.ALL) > @MapKey(name="name") > public Map<String, KeyValue> getProps() { > return props; > } > The correct tables are created and inserting data works fine. When loading, however, I get the error below. > When using a join column, everything works fine: > @OneToMany(cascade=CascadeType.ALL) > @MapKey(name="name") > @JoinColumn(name="myentity_id") > public Map<String, KeyValue> getProps() { > return props; > } > Attached the two test classes. > The error: > ... > Hibernate: select this_.id as id3_0_ from test_MyEntity this_ > Hibernate: select props0_.MyEntity_id as MyEntity1_1_, props0_.props_id as props2_1_, props0_.name as formula0_1_, keyvalue1_.id as id2_0_, keyvalue1_.val as val2_0_, keyvalue1_.name as name2_0_ from test_MyEntity_KeyValue props0_ left outer join test_KeyValue keyvalue1_ on props0_.props_id=keyvalue1_.id where props0_.MyEntity_id=? > 15:11:49,078 WARN JDBCExceptionReporter:71 - SQL Error: 1054, SQLState: 42S22 > Exception in thread "main" 15:11:49,078 ERROR JDBCExceptionReporter:72 - null, message from server: "Unknown column 'props0_.name' in 'field list'" > org.hibernate.exception.SQLGrammarException: could not initialize a collection: [test.data.MyEntity.props#1] > at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) > at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1923) > at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71) > at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) > at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1565) > at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) > at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) > at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:161) > at org.hibernate.collection.PersistentMap.get(PersistentMap.java:127) > at test.TestKeyValue.test(TestKeyValue.java:43) > at test.TestKeyValue.main(TestKeyValue.java:57) > Caused by: java.sql.SQLException: null, message from server: "Unknown column 'props0_.name' in 'field list'" > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1876) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1098) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1192) > at com.mysql.jdbc.Connection.execSQL(Connection.java:2051) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496) > at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137) > at org.hibernate.loader.Loader.getResultSet(Loader.java:1676) > at org.hibernate.loader.Loader.doQuery(Loader.java:662) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1916) > ... 10 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Todd O (JIRA) <no...@at...> - 2006-06-14 15:45:34
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-374?page=comments#action_23336 ] Todd O commented on ANN-374: ---------------------------- I've upgraded to core 3.2.0cr2 and annotations 3.2.0.cr1. I've attached v2 sources. Hibernate is still writing incorrect sql, but now it's different incorrect sql: Hibernate: insert into MyEntity2 values ( ) Hibernate: insert into KeyValue2 (val, name) values (?, ?) Hibernate: insert into KeyValue2 (val, name) values (?, ?) Hibernate: insert into MyEntity2_KeyValue2 (MyEntity2_id, props_id) values (?, ?) Hibernate: insert into MyEntity2_KeyValue2 (MyEntity2_id, props_id) values (?, ?) Hibernate: select this_.id as id1_0_ from MyEntity2 this_ Hibernate: select props0_.MyEntity2_id as MyEntity1_1_, props0_.props_id as props2_1_, select a15.name from KeyValue2 as a15 where a15.id=props0_.props_id as formula0_1_, keyvalue2x1_.id as id0_0_, keyvalue2x1_.val as val0_0_, keyvalue2x1_.name as name0_0_ from MyEntity2_KeyValue2 props0_ left outer join KeyValue2 keyvalue2x1_ on props0_.props_id=keyvalue2x1_.id where props0_.MyEntity2_id=? Jun 13, 2006 9:36:09 PM org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 1064, SQLState: 42000 Jun 13, 2006 9:36:09 PM org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select a15.name from KeyValue2 as a15 where a15.id=props0_.props_id as formula0_' at line 1 > Map - OneToMany w or w/o join table creates bad sql > --------------------------------------------------- > > Key: ANN-374 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-374 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Versions: 3.1beta6 > Environment: Hibernate 3.1 RC1, Annotations 3.1b6, Java 1.5.0_05 > Reporter: Todd O > Assignee: Emmanuel Bernard > Fix For: 3.2.0.cr1 > Attachments: KeyValue2.java, MyEntity2.java, TestKeyValue2.java > > > Seems like there is a problem with mapping a Map using join table. > I have a relation like this: > @OneToMany(cascade=CascadeType.ALL) > @MapKey(name="name") > public Map<String, KeyValue> getProps() { > return props; > } > The correct tables are created and inserting data works fine. When loading, however, I get the error below. > When using a join column, everything works fine: > @OneToMany(cascade=CascadeType.ALL) > @MapKey(name="name") > @JoinColumn(name="myentity_id") > public Map<String, KeyValue> getProps() { > return props; > } > Attached the two test classes. > The error: > ... > Hibernate: select this_.id as id3_0_ from test_MyEntity this_ > Hibernate: select props0_.MyEntity_id as MyEntity1_1_, props0_.props_id as props2_1_, props0_.name as formula0_1_, keyvalue1_.id as id2_0_, keyvalue1_.val as val2_0_, keyvalue1_.name as name2_0_ from test_MyEntity_KeyValue props0_ left outer join test_KeyValue keyvalue1_ on props0_.props_id=keyvalue1_.id where props0_.MyEntity_id=? > 15:11:49,078 WARN JDBCExceptionReporter:71 - SQL Error: 1054, SQLState: 42S22 > Exception in thread "main" 15:11:49,078 ERROR JDBCExceptionReporter:72 - null, message from server: "Unknown column 'props0_.name' in 'field list'" > org.hibernate.exception.SQLGrammarException: could not initialize a collection: [test.data.MyEntity.props#1] > at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) > at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1923) > at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71) > at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) > at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1565) > at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) > at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) > at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:161) > at org.hibernate.collection.PersistentMap.get(PersistentMap.java:127) > at test.TestKeyValue.test(TestKeyValue.java:43) > at test.TestKeyValue.main(TestKeyValue.java:57) > Caused by: java.sql.SQLException: null, message from server: "Unknown column 'props0_.name' in 'field list'" > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1876) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1098) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1192) > at com.mysql.jdbc.Connection.execSQL(Connection.java:2051) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496) > at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137) > at org.hibernate.loader.Loader.getResultSet(Loader.java:1676) > at org.hibernate.loader.Loader.doQuery(Loader.java:662) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1916) > ... 10 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Todd O (JIRA) <no...@at...> - 2006-06-14 15:43:36
|
Map - OneToMany w or w/o join table creates bad sql --------------------------------------------------- Key: ANN-374 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-374 Project: Hibernate Annotations Type: Improvement Components: binder Versions: 3.1beta6 Environment: Hibernate 3.1 RC1, Annotations 3.1b6, Java 1.5.0_05 Reporter: Todd O Assigned to: Emmanuel Bernard Fix For: 3.2.0.cr1 Seems like there is a problem with mapping a Map using join table. I have a relation like this: @OneToMany(cascade=CascadeType.ALL) @MapKey(name="name") public Map<String, KeyValue> getProps() { return props; } The correct tables are created and inserting data works fine. When loading, however, I get the error below. When using a join column, everything works fine: @OneToMany(cascade=CascadeType.ALL) @MapKey(name="name") @JoinColumn(name="myentity_id") public Map<String, KeyValue> getProps() { return props; } Attached the two test classes. The error: ... Hibernate: select this_.id as id3_0_ from test_MyEntity this_ Hibernate: select props0_.MyEntity_id as MyEntity1_1_, props0_.props_id as props2_1_, props0_.name as formula0_1_, keyvalue1_.id as id2_0_, keyvalue1_.val as val2_0_, keyvalue1_.name as name2_0_ from test_MyEntity_KeyValue props0_ left outer join test_KeyValue keyvalue1_ on props0_.props_id=keyvalue1_.id where props0_.MyEntity_id=? 15:11:49,078 WARN JDBCExceptionReporter:71 - SQL Error: 1054, SQLState: 42S22 Exception in thread "main" 15:11:49,078 ERROR JDBCExceptionReporter:72 - null, message from server: "Unknown column 'props0_.name' in 'field list'" org.hibernate.exception.SQLGrammarException: could not initialize a collection: [test.data.MyEntity.props#1] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.loadCollection(Loader.java:1923) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1565) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:161) at org.hibernate.collection.PersistentMap.get(PersistentMap.java:127) at test.TestKeyValue.test(TestKeyValue.java:43) at test.TestKeyValue.main(TestKeyValue.java:57) Caused by: java.sql.SQLException: null, message from server: "Unknown column 'props0_.name' in 'field list'" at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1876) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1098) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1192) at com.mysql.jdbc.Connection.execSQL(Connection.java:2051) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137) at org.hibernate.loader.Loader.getResultSet(Loader.java:1676) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223) at org.hibernate.loader.Loader.loadCollection(Loader.java:1916) ... 10 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Bill S. (JIRA) <no...@at...> - 2006-06-14 15:15:46
|
discussion: implicit joins are always INNER ------------------------------------------- Key: HHH-1837 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1837 Project: Hibernate3 Type: Improvement Reporter: Bill Schneider It would be helpful to explain the consequences in the docs re. implicit joins always resulting in INNER joins. This causes semantics of HQL expressions to be quite different from similar-looking JSTL expressions. in particular consider (copied from comment on HHH-989) this HQL expression "cat.mate.name= ? OR cat.name=?" if cat.mate is null, this will not return any results, **even if** the right hand cat.name=? expression matches. A similar condition in JSTL (<c:if test="${cat.mate.name = ... || cat.name = ...}">) would behave differently. The HQL behavior may be correct, but sure could be confusing at first. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: igor s. (JIRA) <no...@at...> - 2006-06-14 12:30:50
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-892?page=comments#action_23335 ] igor spasic commented on HHH-892: --------------------------------- Is there any HQL-solution on this subject? I do not care if someone thinks this is not a bug - i need a HQL solution, instead. Or, at the end, any reasonable solution... > HQL parser does not resolve alias in ORDER BY clause > ----------------------------------------------------- > > Key: HHH-892 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-892 > Project: Hibernate3 > Type: New Feature > Versions: 3.0.5 > Environment: Hibernate 3.0.5, MySQL, Tomcat > Reporter: Guido Laures > Priority: Minor > > > When using an alias for an ORDER BY clause this is not always correctly resolved. Example: > SELECT SUM(A.x) AS mySum FROM MyClass AS A GROUP BY A.y ORDER BY mySum > does not work because "mySum" is not resolved in the ORDER BY clause which results in an exception telling that mySum is an unknown column. > Workaround (not to say "hack") is using: > SELECT SUM(A.x) AS mySum FROM MyClass AS A GROUP BY A.y ORDER BY col_0_0_ -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Ignat Z. (JIRA) <no...@at...> - 2006-06-14 12:10:38
|
.class parameter in HQL query not converted into discriminator value properly ----------------------------------------------------------------------------- Key: HHH-1836 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1836 Project: Hibernate3 Type: Bug Components: query-hql Versions: 3.0.5 Environment: Win XP SP2, Hibernate 3.0.5, Sun Java 1.5.0_06 Reporter: Ignat Zapolsky Hello! I have following problem: when using HQL query "select item.id, item.name from Item as item where item.class = ?" and trying to use clause Query.setParameter (0, SubItem.class) I am getting following exception from underlying database since hibernate doese not properly convert parameter into associated discriminator value: 2006-06-14 15:04:30,828 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: -16, SQLState: 37000> 2006-06-14 15:04:30,828 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: -16, SQLState: 37000> 2006-06-14 15:04:30,843 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Wrong data type: For input string: "Item"> 2006-06-14 15:04:30,843 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Wrong data type: For input string: "Item"> org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [select abstractco0_.id as col_0_0_, abstractco0_.name as col_1_0_ from TABLE abstractco0_ where abstractco0_.type=?]; SQL state [37000]; error code [-16]; Wrong data type: For input string: "Item"; nested exception is java.sql.SQLException: Wrong data type: For input string: "Item java.sql.SQLException: Wrong data type: For input string: "Item" at org.hsqldb.jdbc.Util.throwError(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.setParameter(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.setString(Unknown Source) at org.hibernate.type.StringType.set(StringType.java:24) at org.hibernate.type.ClassType.set(ClassType.java:35) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44) at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1115) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1177) at org.hibernate.loader.Loader.doQuery(Loader.java:390) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218) at org.hibernate.loader.Loader.doList(Loader.java:1593) at org.hibernate.loader.Loader.list(Loader.java:1577) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) Please also examine bug http://opensource.atlassian.com/projects/hibernate/browse/HHH-1749 it observes situation from discriminatort to class point of view. PS. There are several forum posts regarding almost same issues: http://forum.hibernate.org/viewtopic.php?t=956408&highlight=discriminator+hql http://forum.hibernate.org/viewtopic.php?t=941125&highlight=discriminator+class+name+hql PPS. If required I could provide sample mappings and code snippets. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Todd O (JIRA) <no...@at...> - 2006-06-14 04:41:35
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-120?page=all ] Todd O updated ANN-120: ----------------------- Attachment: KeyValue2.java MyEntity2.java TestKeyValue2.java I've upgraded to core 3.2.0cr2 and annotations 3.2.0.cr1. I've attached v2 sources. Hibernate is still writing incorrect sql, but now it's different incorrect sql: Hibernate: insert into MyEntity2 values ( ) Hibernate: insert into KeyValue2 (val, name) values (?, ?) Hibernate: insert into KeyValue2 (val, name) values (?, ?) Hibernate: insert into MyEntity2_KeyValue2 (MyEntity2_id, props_id) values (?, ?) Hibernate: insert into MyEntity2_KeyValue2 (MyEntity2_id, props_id) values (?, ?) Hibernate: select this_.id as id1_0_ from MyEntity2 this_ Hibernate: select props0_.MyEntity2_id as MyEntity1_1_, props0_.props_id as props2_1_, select a15.name from KeyValue2 as a15 where a15.id=props0_.props_id as formula0_1_, keyvalue2x1_.id as id0_0_, keyvalue2x1_.val as val0_0_, keyvalue2x1_.name as name0_0_ from MyEntity2_KeyValue2 props0_ left outer join KeyValue2 keyvalue2x1_ on props0_.props_id=keyvalue2x1_.id where props0_.MyEntity2_id=? Jun 13, 2006 9:36:09 PM org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 1064, SQLState: 42000 Jun 13, 2006 9:36:09 PM org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select a15.name from KeyValue2 as a15 where a15.id=props0_.props_id as formula0_' at line 1 > Map, OneToMany, join table or @ManyToMany does not work > ------------------------------------------------------- > > Key: ANN-120 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-120 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Versions: 3.1beta6 > Environment: Hibernate 3.1 RC1, Annotations 3.1b6, Java 1.5.0_05 > Reporter: Mattias Arbin > Assignee: Emmanuel Bernard > Fix For: 3.2.0.cr1 > Attachments: KeyValue.java, KeyValue2.java, MyEntity.java, MyEntity2.java, TestKeyValue.java, TestKeyValue2.java > > > Seems like there is a problem with mapping a Map using join table. > I have a relation like this: > @OneToMany(cascade=CascadeType.ALL) > @MapKey(name="name") > public Map<String, KeyValue> getProps() { > return props; > } > The correct tables are created and inserting data works fine. When loading, however, I get the error below. > When using a join column, everything works fine: > @OneToMany(cascade=CascadeType.ALL) > @MapKey(name="name") > @JoinColumn(name="myentity_id") > public Map<String, KeyValue> getProps() { > return props; > } > Attached the two test classes. > The error: > ... > Hibernate: select this_.id as id3_0_ from test_MyEntity this_ > Hibernate: select props0_.MyEntity_id as MyEntity1_1_, props0_.props_id as props2_1_, props0_.name as formula0_1_, keyvalue1_.id as id2_0_, keyvalue1_.val as val2_0_, keyvalue1_.name as name2_0_ from test_MyEntity_KeyValue props0_ left outer join test_KeyValue keyvalue1_ on props0_.props_id=keyvalue1_.id where props0_.MyEntity_id=? > 15:11:49,078 WARN JDBCExceptionReporter:71 - SQL Error: 1054, SQLState: 42S22 > Exception in thread "main" 15:11:49,078 ERROR JDBCExceptionReporter:72 - null, message from server: "Unknown column 'props0_.name' in 'field list'" > org.hibernate.exception.SQLGrammarException: could not initialize a collection: [test.data.MyEntity.props#1] > at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65) > at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1923) > at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71) > at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) > at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1565) > at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) > at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) > at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:161) > at org.hibernate.collection.PersistentMap.get(PersistentMap.java:127) > at test.TestKeyValue.test(TestKeyValue.java:43) > at test.TestKeyValue.main(TestKeyValue.java:57) > Caused by: java.sql.SQLException: null, message from server: "Unknown column 'props0_.name' in 'field list'" > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1876) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1098) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1192) > at com.mysql.jdbc.Connection.execSQL(Connection.java:2051) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496) > at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137) > at org.hibernate.loader.Loader.getResultSet(Loader.java:1676) > at org.hibernate.loader.Loader.doQuery(Loader.java:662) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1916) > ... 10 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-06-14 00:32:33
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-373?page=all ] Emmanuel Bernard resolved ANN-373: ---------------------------------- Fix Version: 3.2.0 Resolution: Fixed Assign To: Emmanuel Bernard > imports are not done for the full entityname > -------------------------------------------- > > Key: ANN-373 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-373 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Reporter: Max Rydahl Andersen > Assignee: Emmanuel Bernard > Priority: Minor > Fix For: 3.2.0 > > > hbmbinder adds both the simple and fully qualified name into imports. > annotationbinder does not. > e.g. > org.jbossworld.Patient should be added as both "Patient" and "org.jbossworld.Patient" to be aligned with hbmbinder. > hql code completion assumes this. > workaround is to do two looksup instead, one in imports and if that return null do a lookup directly in classmappings -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: daniel f. (JIRA) <no...@at...> - 2006-06-13 22:23:36
|
mysql dialect doesn't contain standard deviation/std() function --------------------------------------------------------------- Key: HHH-1835 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1835 Project: Hibernate3 Type: Bug Components: core Versions: 3.1.3 Environment: hibernate 3.1.3, mysql 4.1.7 Reporter: daniel flesner the oracle9 dialect has the stddev() as: registerFunction( "stddev", new StandardSQLFunction("stddev", Hibernate.DOUBLE) ); the mysql dialect doesn't have a definition, i believe it should be: registerFunction( "stddev", new StandardSQLFunction("std", Hibernate.DOUBLE) ); -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-06-13 19:41:39
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1834?page=comments#action_23333 ] Max Rydahl Andersen commented on HHH-1834: ------------------------------------------ a unit test showing what you are actually fixing would be beneficial > Ability to fetch joined entities lazily in Criteria > --------------------------------------------------- > > Key: HHH-1834 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1834 > Project: Hibernate3 > Type: Patch > Components: query-criteria > Versions: 3.1.3 > Reporter: Tony Voss > Attachments: criteria-lazy-fetch-joins-patch.patch, criteria-lazy-fetch-joins-patch.zip > > > We needed the ability to fetch joined entities lazily -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-06-13 19:36:33
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1833?page=all ] Max Rydahl Andersen closed HHH-1833: ------------------------------------ Fix Version: 3.2.0 Resolution: Won't Fix we don't throw this exception from the sf creation since it is "secondary" behavior and exceptions in schemaexport/update or dialect detection should not prevent your application to start up. If you want to verify the connection works open a session. > Not Generating HibernateException > --------------------------------- > > Key: HHH-1833 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1833 > Project: Hibernate3 > Type: Bug > Components: metamodel > Environment: Hibernate3, Postgresql 8.1.404 > Reporter: David Phan > Fix For: 3.2.0 > > > The Configuration.buildSessionFactory() method is supposed to throw a HibernateException. I have the following code snippet below. This is supposed to test if users enter the correct URL, username and password for a database. I would expect that if any of those is wrong the HibernateException would be thrown. But it's not. I believe the bug is in the org.hibernate.cfg.SettingsFactory class, where the SQLException is caught. All it does is logging a warning rather than throwing a HibernateException. > If any of the URL, username, password is incorrect, then is there any reason to log a warning and then move forward? I don't think so. > try > { > AnnotationConfiguration testSessionFactory = new AnnotationConfiguration(); > //testSessionFactory.setProperty(Environment.HBM2DDL_AUTO, "update"); > testSessionFactory.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect"); > testSessionFactory.setProperty("hibernate.connection.driver_class", "org.postgresql.Driver"); > testSessionFactory.setProperty("hibernate.cache.use_second_level_cache", "false"); > testSessionFactory.setProperty("hibernate.connection.url", url); > testSessionFactory.setProperty("hibernate.connection.username", username); > testSessionFactory.setProperty("hibernate.connection.password", password); > > testSessionFactory.buildSessionFactory(); > success = true; > } > catch (HibernateException e) > { > // Log here that test fails > System.out.println("Fail to connect to database: " + e.toString()); > success = false; > } > catch (Throwable t) > { > success = false; > } -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-06-13 19:34:41
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-373?page=comments#action_23331 ] Max Rydahl Andersen commented on ANN-373: ----------------------------------------- getImports().get("Patient") returns "org.jbossworld.Patient" getImports().get("org.jbossworld.Patient") returns null (it should also return "org.jbossworld.Patient" to be equal to what hbmbinder provides. > imports are not done for the full entityname > -------------------------------------------- > > Key: ANN-373 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-373 > Project: Hibernate Annotations > Type: Improvement > Components: binder > Reporter: Max Rydahl Andersen > Priority: Minor > > > hbmbinder adds both the simple and fully qualified name into imports. > annotationbinder does not. > e.g. > org.jbossworld.Patient should be added as both "Patient" and "org.jbossworld.Patient" to be aligned with hbmbinder. > hql code completion assumes this. > workaround is to do two looksup instead, one in imports and if that return null do a lookup directly in classmappings -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Eric M. (JIRA) <no...@at...> - 2006-06-13 19:12:35
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1312?page=comments#action_23330 ] Eric Molitor commented on HHH-1312: ----------------------------------- There is the possibility of leaking resources with a poorly implemented JDBC driver when resultsets are not properly closed. (So the hygenic cleanup would be greatly appreciated.) To disable this behavior in JBoss open up the *-DS.xml file that you are using for Hibernate and set <track-statements>true</track-statements> to false. (Or just comment it out.) > Unclosed ResultSet when using Identity > -------------------------------------- > > Key: HHH-1312 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1312 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.1 rc3, 3.1, 3.1 rc2 > Environment: JBoss 4.0.3SP1 > Hibernate 3.1rc2 > Java 1.5.0_06 > MSSQLServer 2000 > Reporter: Michael Samblanet > Priority: Minor > > > The code around AbstractEntityPersister.java line 1969 obtains a result set using GetGeneratedKeysHelper.getGeneratedKey > but the result set is never closed by this function nor the functions it calls. The issue was exposed by the > message below in JBoss 4.0.3 SP1. > This is an EJB3 application on JBoss using MSSQLServer 2000 and we are persisting an object with a primary key using an > identity data type. > A review of the Hibernate 3.1 source code seems to indicate it has the same issue. > 11:29:30,817 WARN [WrappedConnection] Closing a result set you left open! Please close it yourself. > java.lang.Throwable: STACKTRACE > at org.jboss.resource.adapter.jdbc.WrappedStatement.registerResultSet(WrappedStatement.java:572) > at org.jboss.resource.adapter.jdbc.WrappedStatement.getGeneratedKeys(WrappedStatement.java:501) > 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 org.hibernate.util.GetGeneratedKeysHelper.getGeneratedKey(GetGeneratedKeysHelper.java:59) > at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1969) > at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2404) > at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37) > at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243) > at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269) > at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167) > at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101) > at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131) > at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87) > at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38) > at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:590) > at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:568) > at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:130) > at org.jboss.ejb3.entity.InjectedEntityManager.persist(InjectedEntityManager.java:97) > <snip> -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Martin S. (JIRA) <no...@at...> - 2006-06-13 17:42:36
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-796?page=comments#action_23329 ] Martin Schulz commented on HHH-796: ----------------------------------- As per this comment in Dom4jComponentTuplizer: //TODO: currently we don't know a SessionFactory reference when building the Tuplizer // THIS IS A BUG (embedded-xml=false on component) Once the Tuplizer is factory-aware, it can override AbstractComponentTuplizer.setPropertyValues(): public void setPropertyValues(Object component, Object[] values) throws HibernateException { for ( int i = 0; i < propertySpan; i++ ) { setters[i].set( component, values[i], null ); } } [ the null factory here is what causes the NPE ]. > Hibernate fails to determine identifier of association inside composite-element in EntityMode.DOM4J when declared with embed-xml="false" > ---------------------------------------------------------------------------------------------------------------------------------------- > > Key: HHH-796 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-796 > Project: Hibernate3 > Type: Bug > Versions: 3.0.5 > Environment: Hibernate 3.0.5; Windows; MySQL 4.1 > Reporter: Vladimir Demochko > Fix For: 3.2.0 > Attachments: TestBug.zip > > > Having the following mapping declaration: > <class name="Parent"> > <id name="id"/> > <property name="label"/> > <bag name="associations" table="ASSOCIATION" cascade="all"> > <key column="PARENT_ID"/> > <composite-element class="Association" node="associations"> > <parent name="parent"/> > <many-to-one name="child" class="Child" column="CHILD_ID" node="child" embed-xml="false"/> > <property name="info" column="INFO" type="string"/> > </composite-element> > </bag> > </class> > <class name="Child"> > <id name="id"/> > <property name="info"/> > </class> > Hibernate fails with NullPointerException while constructing Parent/assosiations/child element (in fact while getting an identifier of a Child object) in EntityMode.DOM4J: > java.lang.NullPointerException > at org.hibernate.type.EntityType.getIdentifierType(EntityType.java:227) > at org.hibernate.type.EntityType.setToXMLNode(EntityType.java:417) > at org.hibernate.property.Dom4jAccessor$ElementSetter.set(Dom4jAccessor.java:307) > at org.hibernate.tuple.AbstractComponentTuplizer.setPropertyValues(AbstractComponentTuplizer.java:80) > at org.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:262) > at org.hibernate.type.ComponentType.resolve(ComponentType.java:446) > at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:182) > at org.hibernate.persister.collection.AbstractCollectionPersister.readElement(AbstractCollectionPersister.java:612) > at org.hibernate.collection.PersistentElementHolder.readFrom(PersistentElementHolder.java:97) > at org.hibernate.loader.Loader.readCollectionElement(Loader.java:645) > at org.hibernate.loader.Loader.readCollectionElements(Loader.java:355) > at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:306) > at org.hibernate.loader.Loader.doQuery(Loader.java:395) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1401) > at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:107) > at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:483) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) > at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1422) > at org.hibernate.type.CollectionType.getCollection(CollectionType.java:474) > at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:332) > at org.hibernate.type.CollectionType.resolve(CollectionType.java:326) > at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:105) > at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:510) > at org.hibernate.loader.Loader.doQuery(Loader.java:419) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210) > at org.hibernate.loader.Loader.loadEntity(Loader.java:1312) > at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116) > at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101) > at org.hibernate.persister.entity.BasicEntityPersister.load(BasicEntityPersister.java:2461) > at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:350) > at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:331) > at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113) > at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:151) > at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79) > at org.hibernate.impl.SessionImpl.get(SessionImpl.java:617) > at org.hibernate.impl.SessionImpl.get(SessionImpl.java:610) > at TestBug.main(TestBug.java:21) -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Martin S. (JIRA) <no...@at...> - 2006-06-13 17:32:42
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-446?page=comments#action_23328 ] Martin Schulz commented on HHH-446: ----------------------------------- > I'm not at all sure that use of <key-many-to-one> with XML is a good thing. I have a many-to-one referencing a child table with a composite id. Conventional wisdom around here tells me that that this is tricky, but can be setup with a key-many-to-one bi-di mapping. I don't really technically _need_ the reverse navigation though though. What I need is to avoid the recursion... The request appears rather reasonable and Gavin's comment censatory. > The is no possibility to specify embed-xml on key-many-to-one tag > ----------------------------------------------------------------- > > Key: HHH-446 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-446 > Project: Hibernate3 > Type: Improvement > Components: core > Versions: 3.0.2 > Environment: MySQL > Reporter: Markus Jessenitschnig > Priority: Minor > > > It is not possible to specify embed-xml="false" on key-many-to-one tags within composite-id tag like it is possible for many-to-one relations. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Tony V. (JIRA) <no...@at...> - 2006-06-13 16:45:49
|
Ability to fetch joined entities lazily in Criteria --------------------------------------------------- Key: HHH-1834 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1834 Project: Hibernate3 Type: Patch Components: query-criteria Versions: 3.1.3 Reporter: Tony Voss Attachments: criteria-lazy-fetch-joins-patch.patch, criteria-lazy-fetch-joins-patch.zip We needed the ability to fetch joined entities lazily -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: David P. (JIRA) <no...@at...> - 2006-06-13 15:50:32
|
Not Generating HibernateException --------------------------------- Key: HHH-1833 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1833 Project: Hibernate3 Type: Bug Components: metamodel Environment: Hibernate3, Postgresql 8.1.404 Reporter: David Phan The Configuration.buildSessionFactory() method is supposed to throw a HibernateException. I have the following code snippet below. This is supposed to test if users enter the correct URL, username and password for a database. I would expect that if any of those is wrong the HibernateException would be thrown. But it's not. I believe the bug is in the org.hibernate.cfg.SettingsFactory class, where the SQLException is caught. All it does is logging a warning rather than throwing a HibernateException. If any of the URL, username, password is incorrect, then is there any reason to log a warning and then move forward? I don't think so. try { AnnotationConfiguration testSessionFactory = new AnnotationConfiguration(); //testSessionFactory.setProperty(Environment.HBM2DDL_AUTO, "update"); testSessionFactory.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect"); testSessionFactory.setProperty("hibernate.connection.driver_class", "org.postgresql.Driver"); testSessionFactory.setProperty("hibernate.cache.use_second_level_cache", "false"); testSessionFactory.setProperty("hibernate.connection.url", url); testSessionFactory.setProperty("hibernate.connection.username", username); testSessionFactory.setProperty("hibernate.connection.password", password); testSessionFactory.buildSessionFactory(); success = true; } catch (HibernateException e) { // Log here that test fails System.out.println("Fail to connect to database: " + e.toString()); success = false; } catch (Throwable t) { success = false; } -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |