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: <no...@at...> - 2006-06-29 17:01:20
|
Make possible to specify an @EmbeddedId's field in a @OneToMany's mappedBy = property ---------------------------------------------------------------------------= -------- Key: ANN-381 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN= -381 Project: Hibernate Annotations Type: Improvement Components: binder =20 Environment: Hibernate's annotations packaged in JBoss EJB 3.0 RC8- FD Microsoft SQL Server 2000 Reporter: Pierre Four=C3=A8s As described in hibernate forum (http://forum.hibernate.org/viewtopic.php?t= =3D960763) and discussed with Emmanuel, it would be very nice to be able to= specify in an @OneToMany's mappedBy property the field of an @EmbeddedId. For example, i would like to be able run this example : @Entity public class Card { @OneToMany(cascade=3DCascadeType.ALL, fetch=3DFetchType.EAGER, mappedBy= =3D"primaryKey.card") private Set<CardField> fields;=20 } @Entity public class CardField implements Field { @EmbeddedId private PrimaryKey primaryKey =3D new PrimaryKey(); =20 @Embeddable class PrimaryKey implements Serializable { @ManyToOne(optional =3D false) private Card card; =20 @ManyToOne(optional =3D false) private Key key; } } @Entity public class Key {} --=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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Steve E. (JIRA) <no...@at...> - 2006-06-29 16:11:18
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1565?page=all ] Steve Ebersole closed HHH-1565: ------------------------------- Resolution: Duplicate quite true > Cascade refresh and new instances > ---------------------------------- > > Key: HHH-1565 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1565 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Daniel Stern > > > I have a report that if you have a managed object, with a reference to a new object, where cascade refresh is enabled, and you refresh the managed object, then you will get an exception as refresh tries to cascade to the new object. In fact, the new object should just be ignored. > Looking at the code, this does appear to be the case. -- 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: Steve E. (JIRA) <no...@at...> - 2006-06-29 16:09:16
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-1563?page=all ] Steve Ebersole closed HB-1563: ------------------------------ Resolution: Won't Fix HQL does not allow queries as "from clause elements". Use Hibernate's natiove SQL query support to acheive what you want here... > column alias > ------------ > > Key: HB-1563 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-1563 > Project: Hibernate2 > Type: Bug > Environment: Hibernate 2.0, Cloudscape > Reporter: Nithya Priya > > > Hi, > I have a table that contains 2 columns course_id and sbu, if I want to take the max of the count of course_id > using a simple sql query I can use > select max(cnt) from (select count(course_id) cnt from table group by course_id) > but if I use HQL its giving me query exception if I try to use an alias(cnt in the above case) for the column. Is there any other solution for this problem??? > Thanks in advance -- 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: Levi P. (JIRA) <no...@at...> - 2006-06-29 15:15:15
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-204?page=comments#action_23493 ] Levi Purvis commented on EJB-204: --------------------------------- Works fine from svn head. Close it out. :-) > ClassCastException when using <mapped-superclass> in orm.xml > ------------------------------------------------------------ > > Key: EJB-204 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-204 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.2.0.cr1 > Environment: Hibernate 3.2.0 cr2, EntityManager 3.2.0 cr1 and Annotations 3.2.0 cr1 > Reporter: Levi Purvis > Priority: Minor > > > Using a <mapped-superclass> element in orm.xml will generate the following exception: > javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0 > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217) > at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) > ...... > Caused by: java.lang.ClassCastException: $Proxy0 > at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.getMappedSuperclass(EJB3OverridenAnnotationReader.java:1688) > at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.initAnnotations(EJB3OverridenAnnotationReader.java:285) > at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.isAnnotationPresent(EJB3OverridenAnnotationReader.java:257) > at org.hibernate.reflection.java.JavaXAnnotatedElement.isAnnotationPresent(JavaXAnnotatedElement.java:40) > at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:237) > at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) > at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1015) > at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:751) > at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205) > ... 19 more > Also see the following thread: > http://forum.hibernate.org/viewtopic.php?t=960744 -- 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: Steve E. (JIRA) <no...@at...> - 2006-06-29 14:55:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1838?page=all ] Steve Ebersole resolved HHH-1838: --------------------------------- Resolution: Fixed fixed. pertinent tests are: org.hibernate.test.hql.HQLTest#testManyToAnyReferences org.hibernate.test.hql.ASTParserLoadingTest#testAnyMappingReference > 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 > Assignee: Steve Ebersole > Fix For: 3.2.0.cr3 > 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: Steve E. (JIRA) <no...@at...> - 2006-06-29 14:53:15
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1838?page=all ] Steve Ebersole updated HHH-1838: -------------------------------- Fix Version: 3.2.0.cr3 Assign To: Steve Ebersole Priority: Major (was: Blocker) > 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 > Assignee: Steve Ebersole > Fix For: 3.2.0.cr3 > 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: Emmanuel B. (JIRA) <no...@at...> - 2006-06-29 13:32:17
|
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-204?page=comments#action_23491 ] Emmanuel Bernard commented on EJB-204: -------------------------------------- I can't make it fail on head, can you test your example from SVN head (hibernate core, annotations and entitymanager)? > ClassCastException when using <mapped-superclass> in orm.xml > ------------------------------------------------------------ > > Key: EJB-204 > URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-204 > Project: Hibernate Entity Manager > Type: Bug > Components: EntityManager > Versions: 3.2.0.cr1 > Environment: Hibernate 3.2.0 cr2, EntityManager 3.2.0 cr1 and Annotations 3.2.0 cr1 > Reporter: Levi Purvis > Priority: Minor > > > Using a <mapped-superclass> element in orm.xml will generate the following exception: > javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0 > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217) > at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) > at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) > ...... > Caused by: java.lang.ClassCastException: $Proxy0 > at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.getMappedSuperclass(EJB3OverridenAnnotationReader.java:1688) > at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.initAnnotations(EJB3OverridenAnnotationReader.java:285) > at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.isAnnotationPresent(EJB3OverridenAnnotationReader.java:257) > at org.hibernate.reflection.java.JavaXAnnotatedElement.isAnnotationPresent(JavaXAnnotatedElement.java:40) > at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:237) > at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) > at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1015) > at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:751) > at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151) > at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205) > ... 19 more > Also see the following thread: > http://forum.hibernate.org/viewtopic.php?t=960744 -- 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: Manuel D. S. (JIRA) <no...@at...> - 2006-06-29 13:14:20
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1700?page=comments#action_23490 ] Manuel Dominguez Sarmiento commented on HHH-1700: ------------------------------------------------- I've executed a query similar to the one you describe (same query, different table) directly in Oracle and it works fine. Judging from the error code, it seems like the ? parameter replacement does not match the SQL type in the table. Make sure you pass the correct array of Hibernate Type instances to the CustomProjections factory, that sounds like the culprit. You can get instances of Type from static fields in class Hibernate (Hibernate.LONG, Hibernate.STRING, etc.) > HAVING clause not supported in Criteria API > ------------------------------------------- > > Key: HHH-1700 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1700 > Project: Hibernate3 > Type: New Feature > Components: query-criteria > Versions: 3.1.3 > Environment: Hibernate 3.1.3, Oracle 10g (not DB specific) > Reporter: Manuel Dominguez Sarmiento > Priority: Minor > Attachments: CustomProjections.java > > Original Estimate: 2 hours > Remaining: 2 hours > > Currently the Criteria API does not support the HAVING clause. I have create a factory class which creates Projection instances using sqlGroupProjection. Probably not the best approach, but an idea which could be further developed. These factory methods could be included in the Projections factory class. > Usage example w/one property: > criteria.setProjection(CustomProjections.groupByHaving("id", Hibernate.LONG, "count(distinct id) >= 3")); > Also allows aliases: > criteria.setProjection(CustomProjections.groupByHaving("id", "idAlias", Hibernate.LONG, "count(distinct idAlias) >= 3")); > Usage example w/many properties: > String[] columns = new String[2]; > columns[0] = "id"; > columns[1] = "name"; > String[] aliases = new String[2]; > aliases[0] = "idAlias"; > aliases[1] = "nameAlias"; > Type[] types = new Type[2]; > types[0] = Hibernate.LONG; > types[1] = Hibernate.STRING; > criteria.setProjection(CustomProjections.groupByHaving(columns, aliases, types, "count(distinct id) >= 3 and name='george'")); -- 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: Tobias (JIRA) <no...@at...> - 2006-06-29 12:34:51
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1565?page=comments#action_23483 ] Tobias commented on HHH-1565: ----------------------------- This is a duplicate of HHH-1280. > Cascade refresh and new instances > ---------------------------------- > > Key: HHH-1565 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1565 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Daniel Stern > > > I have a report that if you have a managed object, with a reference to a new object, where cascade refresh is enabled, and you refresh the managed object, then you will get an exception as refresh tries to cascade to the new object. In fact, the new object should just be ignored. > Looking at the code, this does appear to be the case. -- 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: Tobias (JIRA) <no...@at...> - 2006-06-29 12:34:49
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1280?page=comments#action_23482 ] Tobias commented on HHH-1280: ----------------------------- It does, and we need a quite ugly workaround to circumvent this. We check the problematic relations before "refresh" and remove all Entities which have no identifier yet. > Cascade refresh and new instances > --------------------------------- > > Key: HHH-1280 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1280 > Project: Hibernate3 > Type: Bug > Components: core > Reporter: Gavin King > > > I have a report that if you have a managed object, with a reference to a new object, where cascade refresh is enabled, and you refresh the managed object, then you will get an exception as refresh tries to cascade to the new object. In fact, the new object should just be ignored. > Looking at the code, this does appear to be the case. -- 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: Nithya P. (JIRA) <no...@at...> - 2006-06-29 12:24:50
|
column alias ------------ Key: HB-1563 URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-1563 Project: Hibernate2 Type: Bug Environment: Hibernate 2.0, Cloudscape Reporter: Nithya Priya Hi, I have a table that contains 2 columns course_id and sbu, if I want to take the max of the count of course_id using a simple sql query I can use select max(cnt) from (select count(course_id) cnt from table group by course_id) but if I use HQL its giving me query exception if I try to use an alias(cnt in the above case) for the column. Is there any other solution for this problem??? Thanks in advance -- 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: Eduard H. (JIRA) <no...@at...> - 2006-06-29 10:48:50
|
NullPointerException in org.hibernate.util.ComparableComparator --------------------------------------------------------------- Key: HHH-1866 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1866 Project: Hibernate3 Type: Bug Versions: 3.2.0.cr2 Environment: - Hibernate 3.2.0 CR2 - Spring 1.2.5 - JBoss Cache 1.4 - Oracle 9i - Windows and Linux Reporter: Eduard Hildebrandt I think that org.hibernate.util.ComparableComparator or OptimisticTreeCache.DataVersionAdapter has a bug. "return ((Comparable) x).compareTo(y);" throws a NullPointerException if x is a null pointer. org.hibernate.util.ComparableComparator. compare(..) is called from OptimisticTreeCache.DataVersionAdapter in line "return versionComparator.compare( previousVersion, other ) > 1;". We get this NullPointerExption if we use Hibernate with org.hibernate.cache.OptimisticTreeCacheProvider which causes an org.springframework.transaction.UnexpectedRollbackException. Greetings from Germany! -- 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: Alexandre K. (JIRA) <no...@at...> - 2006-06-29 10:33:51
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1700?pa= ge=3Dcomments#action_23481 ]=20 Alexandre KOZLOV commented on HHH-1700: --------------------------------------- The same problem with aliases, but I can't resolve it... If I didn't use alias at all, the generated SQL looks correct: select pos_val_cod from POSITION this_ where this_.POS_DARR=3D? group by po= s_val_cod having min(pos_Cours) > 10 But it gives Hibernate: select pos_val_cod from POSITION this_ where this_.POS_DARR=3D? = group by pos_val_cod having min(pos_Cours) > 10 java.lang.NullPointerException =09at org.hibernate.loader.criteria.CriteriaLoader.getResultColumnOrRow(Cri= teriaLoader.java:107) Exception come originally from CriteriaLoader who can't find aliases. If I call your class with an alias (with the second StringBuffer, of course= ), SQL is: select pos_val_cod as toto from POSITION this_ where this_.POS_DARR=3D? gro= up by pos_val_cod having min(pos_Cours) > 10 But it doesn't work neither: INFO - could not read column value from result set: toto; Echec de convers= ion dans la repr=C3=A9sentation interne WARN - SQL Error: 17059, SQLState: null ERROR - Echec de conversion dans la repr=C3=A9sentation interne org.hibernate.exception.GenericJDBCException: could not execute query Any ideas? Hibernate 3.1. > HAVING clause not supported in Criteria API > ------------------------------------------- > > Key: HHH-1700 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1700 > Project: Hibernate3 > Type: New Feature > Components: query-criteria > Versions: 3.1.3 > Environment: Hibernate 3.1.3, Oracle 10g (not DB specific) > Reporter: Manuel Dominguez Sarmiento > Priority: Minor > Attachments: CustomProjections.java > > Original Estimate: 2 hours > Remaining: 2 hours > > Currently the Criteria API does not support the HAVING clause. I have cr= eate a factory class which creates Projection instances using sqlGroupProje= ction. Probably not the best approach, but an idea which could be further = developed. These factory methods could be included in the Projections fact= ory class. > Usage example w/one property: > criteria.setProjection(CustomProjections.groupByHaving("id", Hibernate.LO= NG, "count(distinct id) >=3D 3")); > Also allows aliases: > criteria.setProjection(CustomProjections.groupByHaving("id", "idAlias", H= ibernate.LONG, "count(distinct idAlias) >=3D 3")); > Usage example w/many properties: > String[] columns =3D new String[2]; > columns[0] =3D "id"; > columns[1] =3D "name"; > String[] aliases =3D new String[2]; > aliases[0] =3D "idAlias"; > aliases[1] =3D "nameAlias"; > Type[] types =3D new Type[2]; > types[0] =3D Hibernate.LONG; > types[1] =3D Hibernate.STRING; > criteria.setProjection(CustomProjections.groupByHaving(columns, aliases, = types, "count(distinct id) >=3D 3 and name=3D'george'")); --=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= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Mattias J. (JIRA) <no...@at...> - 2006-06-29 06:34:51
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-123?page=comments#action_23480 ] Mattias Jiderhamn commented on HB-123: -------------------------------------- > Of course there is no way to "hide" them at the SQL row level, and that is also why thy are exposed by default. If eager fetching of collections is disabled one could use SQL DISTINCT (unless there is something here I don't see). I have no idea whether that that would (generally) perform better than eager fetching and filtering in Java. (Maybe this could be an option, globally or per query???) > Apply distinctness to HQL fetch of collection > --------------------------------------------- > > Key: HB-123 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-123 > Project: Hibernate2 > Type: Improvement > Components: core > Versions: 2.0 final > Reporter: Steve Knight > Priority: Minor > > > HQL fetch of an associated collection should return distinct entities. > For example, the following HQL: > "FROM Department dept LEFT JOIN FETCH dept.personnel" > should return each department(with its associated collection) only once. -- 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-29 03:19:41
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1365?page=all ] Martin Schulz updated HHH-1365: ------------------------------- Attachment: cglib-src-2.1_3.patch This patch for cglib-2.1.3 allows the Enhancer to create the new class always under the ProtectionDomain of the parent. I'm not sure what actually went wrong here, but definitely the requirement to sign the cglib jar file and/or remove the signature from case to case when testing was getting pretty annoying. So the patched cglib.jar is meant to work either way. > NPE AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:372) when trying to load a class defined in a signed/sealed JAR > ---------------------------------------------------------------------------------------------------------------------------------- > > Key: HHH-1365 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1365 > Project: Hibernate3 > Type: Bug > Versions: 3.1 > Environment: Java1.5.06 Ant1.7alpha, hibernate 3.1 > Reporter: Steve Loughran > Priority: Minor > Attachments: cglib-src-2.1_3.patch > > > I'm testing what happens to hibernate when running against a signed JAR. The answer is: most tests pass. What fails is this test (Apache 2.0 license, BTW) > public void testDetachedObject() throws Exception { > Event event = createTestEvent(); > session.save(event); > session.flush(); > closeSession(); > //here the event is detached. > //we change it outside an operation. > String text = "modified"; > event.setText(text); > session = getSessionFactory().openSession(); > Event merged=(Event) session.merge(event); > assertEquals(event, merged); > session.flush(); > closeSession(); > session = getSessionFactory().openSession(); > Event loaded = (Event) session.load(Event.class, event.getKey()); > assertEquals(text, loaded.getText()); > assertEquals(event, loaded); > } > the session.load operation is failing, with the short stack trace of: > java.lang.NullPointerException > at org.hibernate.tuple.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:372) > at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3121) > at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:232) > at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:173) > at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87) > at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:869) > at org.hibernate.impl.SessionImpl.load(SessionImpl.java:788) > at org.hibernate.impl.SessionImpl.load(SessionImpl.java:781) > at d1.persist.test.SessionTest.testDetachedObject(SessionTest.java:155) > The root cause is probably contained in the info that gets printed when the session starts up, complaining that things cant be added to sealed classes > [junit] 2261 ERROR org.hibernate.proxy.BasicLazyInitializer - CGLIB Enhancement failed: d1.persist.Event > [junit] net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > [junit] at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > [junit] at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > [junit] at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > [junit] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:126) > [junit] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41) > [junit] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:161) > [junit] at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:131) > [junit] at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) > [junit] at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64) > [junit] at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257) > [junit] at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) > [junit] at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) > [junit] at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) > [junit] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215) > [junit] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1154) > [junit] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:375) > [junit] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:533) > [junit] at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:109) > [junit] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:155) > [junit] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:82) > [junit] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) > [junit] at d1.persist.PersistTools.createManagerFactory(PersistTools.java:82) > [junit] at d1.persist.PersistTools.createDefaultManagerFactory(PersistTools.java:76) > [junit] at d1.persist.test.Ejb3TestBase.setUp(Ejb3TestBase.java:27) > [junit] at junit.framework.TestCase.runBare(TestCase.java:125) > [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) > [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) > [junit] at junit.framework.TestResult.run(TestResult.java:109) > [junit] at junit.framework.TestCase.run(TestCase.java:118) > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:208) > [junit] at junit.framework.TestSuite.run(TestSuite.java:203) > [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:328) > [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:736) > [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:605) > [junit] Caused by: java.lang.reflect.InvocationTargetException > [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > [junit] at java.lang.reflect.Method.invoke(Method.java:585) > [junit] at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > [junit] at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > [junit] ... 33 more > [junit] Caused by: java.lang.SecurityException: class "d1.persist.Event$$EnhancerByCGLIB$$55c8eae8_2"'s signer information does not match signer information of other classes in the same package > [junit] at java.lang.ClassLoader.checkCerts(ClassLoader.java:775) > [junit] at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487) > [junit] at java.lang.ClassLoader.defineClass(ClassLoader.java:614) > [junit] ... 39 more > [junit] 2262 WARN org.hibernate.tuple.PojoEntityTuplizer - could not create proxy factory for:d1.persist.Event > [junit] org.hibernate.HibernateException: CGLIB Enhancement failed: d1.persist.Event > [junit] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:132) > [junit] at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:41) > [junit] at org.hibernate.tuple.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:161) > [junit] at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:131) > [junit] at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) > [junit] at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64) > [junit] at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257) > [junit] at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) > [junit] at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) > [junit] at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) > [junit] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215) > [junit] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1154) > [junit] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:375) > [junit] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:533) > [junit] at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:109) > [junit] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:155) > [junit] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:82) > [junit] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) > [junit] at d1.persist.PersistTools.createManagerFactory(PersistTools.java:82) > [junit] at d1.persist.PersistTools.createDefaultManagerFactory(PersistTools.java:76) > [junit] at d1.persist.test.Ejb3TestBase.setUp(Ejb3TestBase.java:27) > [junit] at junit.framework.TestCase.runBare(TestCase.java:125) > [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) > [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) > [junit] at junit.framework.TestResult.run(TestResult.java:109) > [junit] at junit.framework.TestCase.run(TestCase.java:118) > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:208) > [junit] at junit.framework.TestSuite.run(TestSuite.java:203) > [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:328) > [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:736) > [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:605) > [junit] Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null > [junit] at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) > [junit] at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) > [junit] at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317) > [junit] at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:126) > [junit] ... 30 more > [junit] Caused by: java.lang.reflect.InvocationTargetException > [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > [junit] at java.lang.reflect.Method.invoke(Method.java:585) > [junit] at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) > [junit] at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) > [junit] ... 33 more > [junit] Caused by: java.lang.SecurityException: class "d1.persist.Event$$EnhancerByCGLIB$$55c8eae8_2"'s signer information does not match signer information of other classes in the same package > [junit] at java.lang.ClassLoader.checkCerts(ClassLoader.java:775) > [junit] at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487) > [junit] at java.lang.ClassLoader.defineClass(ClassLoader.java:614) > [junit] ... 39 more > No doubt there is some way to configure hibernate to create proxies in a different package, and I shall seek that option out. All I want to note here is that NPEs are not the best way to report failure. -- 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: Levi P. (JIRA) <no...@at...> - 2006-06-28 22:14:47
|
ClassCastException when using <mapped-superclass> in orm.xml ------------------------------------------------------------ Key: EJB-204 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-204 Project: Hibernate Entity Manager Type: Bug Components: EntityManager Versions: 3.2.0.cr1 Environment: Hibernate 3.2.0 cr2, EntityManager 3.2.0 cr1 and Annotations 3.2.0 cr1 Reporter: Levi Purvis Priority: Minor Using a <mapped-superclass> element in orm.xml will generate the following exception: javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0 at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) ...... Caused by: java.lang.ClassCastException: $Proxy0 at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.getMappedSuperclass(EJB3OverridenAnnotationReader.java:1688) at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.initAnnotations(EJB3OverridenAnnotationReader.java:285) at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.isAnnotationPresent(EJB3OverridenAnnotationReader.java:257) at org.hibernate.reflection.java.JavaXAnnotatedElement.isAnnotationPresent(JavaXAnnotatedElement.java:40) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:237) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1015) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:751) at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205) ... 19 more Also see the following thread: http://forum.hibernate.org/viewtopic.php?t=960744 -- 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: Stephane L. (JIRA) <no...@at...> - 2006-06-28 22:02:48
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-633?page=comments#action_23462 ] Stephane Landelle commented on HBX-633: --------------------------------------- Hum, quite funny indeed... I'm trying to reverse engineer the spring jpetstore database and I run into the same kind of problem. In this case, the problem is a DATE column named TIMESTAMP. HibernateTool generates a version element with a date type but as org.hibernate.type.DateType doesn't implement org.hibernate.type.VersionType, I get a ClassCastException. > Reverse engineered VERSION columns cause ClassCastException > ----------------------------------------------------------- > > Key: HBX-633 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-633 > Project: Hibernate Tools > Type: Bug > Versions: 3.1beta4 > Environment: Oracle 8i, ojdbc14.jar > Reporter: Gabor Kincses > > > Exception in thread "main" java.lang.ClassCastException: org.hibernate.type.BigDecimalType > at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:83) > at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:157) > at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412) > at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) > at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) > at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216) > at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176) > at com.paypal.bdo.test.Hibernate101.main(Hibernate101.java:37) > I guess the code tries to cast the type to VersionType. -- 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: Levi P. (JIRA) <no...@at...> - 2006-06-28 21:42:47
|
exception when using top-level <access>PROPERTY</access> in orm.xml ------------------------------------------------------------------- Key: EJB-203 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-203 Project: Hibernate Entity Manager Type: Bug Components: EntityManager Versions: 3.2.0.cr1 Environment: Hibernate 3.2.0 cr2, Hibernate Annotations 3.2.0 cr1, Hibernate Entity Manager 3.2.0 cr1 Reporter: Levi Purvis Priority: Minor Consider a simple orm.xml: <?xml version="1.0" encoding="UTF-8"?> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd" version="1.0"> <access>PROPERTY</access> <entity class="Foo"> <table name="FOO" /> </entity> </entity-mappings> The <access>PROPERTY</access> section appears to cause the following exception (JUnit part of the stack removed for clarity): javax.persistence.PersistenceException: org.hibernate.MappingException: could not find PropertyAccessor class: PROPERTY at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) Caused by: org.hibernate.MappingException: could not find PropertyAccessor class: PROPERTY at org.hibernate.property.PropertyAccessorFactory.resolveCustomAccessor(PropertyAccessorFactory.java:107) at org.hibernate.property.PropertyAccessorFactory.getPojoPropertyAccessor(PropertyAccessorFactory.java:86) at org.hibernate.property.PropertyAccessorFactory.getPropertyAccessor(PropertyAccessorFactory.java:53) at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:166) at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:114) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:418) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:223) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760) at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205) ... 19 more Caused by: java.lang.ClassNotFoundException: PROPERTY at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102) at org.hibernate.property.PropertyAccessorFactory.resolveCustomAccessor(PropertyAccessorFactory.java:104) ... 33 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: Spencer U. (JIRA) <no...@at...> - 2006-06-28 19:47:50
|
Inaccurate exception message for setFirstResult in QueryImpl ------------------------------------------------------------ Key: EJB-202 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-202 Project: Hibernate Entity Manager Type: Bug Components: EntityManager Versions: 3.2.0.cr1 Reporter: Spencer Uresk The exception message in org.hibernate.ejb.QueryImpl, setFirstResult method needs to be fixed. When you set a negative value for firstResult, the exception message is "Negative (x) parameter passed in to setMaxResults", which has lead to a bit of confusion. The exception message should be changed to "Negative (x) parameter passed in to setFirstResults". -- 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: Sergey V. (JIRA) <no...@at...> - 2006-06-28 17:21:46
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1775?page=comments#action_23461 ] Sergey Vladimirov commented on HHH-1775: ---------------------------------------- Steve, entrySet calls can be replaced by entryArray calls, as suggested in patch for HHH-1691, for example. Need only one call for building whole array. Another possible solution is to wrap IdentityMap to IdentityMapEntry set/list. One can create set which will updated sync. with IdentityMap. Let me know if it is intersting :) Anyway, +1 for any perfomance-related improvments. > collection batch fetching > ------------------------- > > Key: HHH-1775 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1775 > Project: Hibernate3 > Type: Improvement > Components: core > Reporter: Steve Ebersole > Assignee: Steve Ebersole > Priority: Minor > Fix For: 3.2.1 > > > I have code local on my box to support "peeking" into the second level cache when determining whether to add a particular entity/collection key to a batch load request. If the given key is contained in the second level cache, then do not batch fetch the entity/collection as it will be initialized from second level cache on access. > However, there are still large inefficiencies when performing this for collections; the biggest of which currently is the fact that we retreive a IdentityMap.entrySet for each and ever call to determine a collectiomn fetch batch. For performance reasons, we should align this with how entity batches are handled where the entity keys considered to be "batch loadable" are tracked seperately on the BatchFetchQueue. -- 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: Steve E. (JIRA) <no...@at...> - 2006-06-28 17:19:47
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1828?page=all ] Steve Ebersole resolved HHH-1828: --------------------------------- Resolution: Fixed JDBCContext now explicitly checks for transactions marked for rollback only prior to registering synch > registering a transaction marked for Rollback is illegal > -------------------------------------------------------- > > Key: HHH-1828 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1828 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.2.0.cr2 > Reporter: Emmanuel Bernard > Assignee: Steve Ebersole > Priority: Blocker > Fix For: 3.2.0.cr3 > > > org.hibernate.TransactionException: Could not register synchronization > at org.hibernate.transaction.CMTTransaction.registerSynchronization(CMTTransaction.java:159) > at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:59) > at org.jboss.ejb3.stateful.StatefulBeanContext.closeExtendedPCs(StatefulBeanContext.java:285) > at org.jboss.ejb3.stateful.StatefulBeanContext.remove(StatefulBeanContext.java:269) > ... 48 more > Caused by: javax.transaction.RollbackException: Already marked for rollback, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=null:1149964756546/52, BranchQual=null:1149964756546, localId=0:52] > at org.jboss.tm.TransactionImpl.checkStatus(TransactionImpl.java:2753) > at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:1531) > at org.hibernate.transaction.CMTTransaction.registerSynchronization(CMTTransaction.java:156) > True for CMT and JTA. JoinableCMTTransaction is safe. -- 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: Steve E. (JIRA) <no...@at...> - 2006-06-28 16:46:24
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-434?page=all ] Steve Ebersole updated HHH-434: ------------------------------- Fix Version: 3.2.2 (was: 3.2.0.cr3) > element/@attribute not implemented for collection elements > ---------------------------------------------------------- > > Key: HHH-434 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-434 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.0.3 > Reporter: Gavin King > Fix For: 3.2.2 > > > None of the following: > <element> > <one-to-many> > <many-to-many> > support use of node="element/@attribute", which is *extremely* useful when embed-xml="false" (the common case). > This is because we do not go via property accessors in the PersistentXXXElementHolder classes. Instead, we have hardcoded element iteration in about 16 different methods. > We need to find some design where this can be made more flexible. > Perhaps just CollectionPersister.getElementName() + CollectionPersister.getElementValue()/CollectionPersister.getElementValue() is enough, since PropertyAccessor is certainly not an appropriate solution. > Any volunteers? -- 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: Steve E. (JIRA) <no...@at...> - 2006-06-28 16:46:22
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-874?page=all ] Steve Ebersole updated HHH-874: ------------------------------- Fix Version: 3.2.2 (was: 3.2.0.cr3) > org.hibernate.AssertionFailure: null owner only with EntityMode.DOM4J > --------------------------------------------------------------------- > > Key: HHH-874 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-874 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.1 beta 2 > Environment: Hibernate up to 3.1 beta 2, SQL Server > Reporter: Martin Caslavsky > Fix For: 3.2.2 > > > ERROR - 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: null owner > at org.hibernate.collection.PersistentElementHolder.<init>(PersistentElementHolder.java:61) > at org.hibernate.type.SetType.instantiate(SetType.java:23) > at org.hibernate.engine.CollectionLoadContext.getLoadingCollection(CollectionLoadContext.java:101) > at org.hibernate.loader.Loader.readCollectionElement(Loader.java:990) > at org.hibernate.loader.Loader.readCollectionElements(Loader.java:635) > at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:579) > at org.hibernate.loader.Loader.doQuery(Loader.java:689) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1916) > at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36) > 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:1555) > at org.hibernate.type.CollectionType.getCollection(CollectionType.java:501) > at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:335) > at org.hibernate.type.CollectionType.resolve(CollectionType.java:329) > at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113) > at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842) > at org.hibernate.loader.Loader.doQuery(Loader.java:717) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223) > at org.hibernate.loader.Loader.loadEntity(Loader.java:1782) > at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:47) > at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:41) > at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2705) > at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365) > at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346) > at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123) > at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177) > at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87) > at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:774) > at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:746) > at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) > at org.hibernate.type.EntityType.resolve(EntityType.java:303) > at org.hibernate.type.EntityType.nullSafeGet(EntityType.java:217) > at org.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:93) > at org.hibernate.impl.IteratorImpl.next(IteratorImpl.java:120) > at ProduktCon.result(ProduktCon.java:42) > at AbstractCon.go(AbstractCon.java:114) > at Datacon.main(Datacon.java:31) > ProduktCon.java: > protected void result() { > Session session4 = factory.openSession().getSession(EntityMode.DOM4J); > Query query = session4.createQuery("select p from Produkt as p"); > for (Iterator it = query.iterate(); it.hasNext();) { > Element e = (Element) it.next(); // LINE 42 > } > } > Produkt.hbm.xml: > <?xml version="1.0"?> > <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> > <hibernate-mapping> > <class name="Produkt" table="eshop_prod" node="product"> > <id name="produkt" type="string" unsaved-value="any" column="produkt" node="@id"/> > <property name="cislo" column="Katalogove_cislo" node="@cislo"/> > <property name="popis" column="popis" node="name"/> > <property name="poznamka" column="poznamka" node="anotace"/> > <property name="text" column="text" node="descr"/> > <property name="zaruka" column="zaruka" node="@zaruka"/> > <property name="vyrobce" column="vyrobce" node="vyrobce"/> > <property name="dodavatel" column="dodavatel" node="dodavatel"/> > <property name="zarazeni" column="zarazeni" node="@zarazeni" /> > <property name="dostupnost" column="Carovy_kod_vlastni" node="@dostupnost" /> > <set name="kategorie" embed-xml="true" node="."> > <key column="produkt"/> > <one-to-many class="Kategorie"/> > </set> > <set name="related" embed-xml="true" node="." where="typ_souvislosti=0"> > <key column="produkt"/> > <one-to-many class="Related"/> > </set> > <set name="item" embed-xml="true" node="."> > <key column="vyrobek"/> > <one-to-many class="Item"/> > </set> > <set name="variant" embed-xml="true" node="."> > <key column="prod_id"/> > <one-to-many class="Variant"/> > </set> > </class> > </hibernate-mapping> > Last executed SQL statement: > Hibernate: select variant0_.prod_id as prod5_1_, variant0_.produkt as produkt1_, variant0_.produkt as produkt4_0_, variant0_.Katalogove_cislo as Katalogove2_4_0_, variant0_.Udaj_1 as Udaj3_4_0_, variant0_.Udaj_2 as Udaj4_4_0_ from data0001.dbo.eshop_variant variant0_ where variant0_.prod_id=? > This error occurs only with EntityMode.DOM4J. > Also when removed <set name="variant" ... > everything works OK. -- 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: Steve E. (JIRA) <no...@at...> - 2006-06-28 16:46:20
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-616?page=all ] Steve Ebersole updated HHH-616: ------------------------------- Fix Version: 3.2.2 (was: 3.2.0.cr3) > replicate() with a bidirectional relationship fails (dom4j) > ----------------------------------------------------------- > > Key: HHH-616 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-616 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.0.5 > Environment: Hibernate 3.0.5; MySQL 4.1.12 > Reporter: David Tashima > Assignee: Gavin King > Fix For: 3.2.2 > Attachments: test.zip, test3.zip > > > Here is the original forum post: > http://forum.hibernate.org/viewtopic.php?t=943520 > Basically, I am trying to transfer stuff from one DB to another via the Dom4j session. I create an XML document from the source DB and then I am using session.replicate() on the receiving end to instantiate the new objects from that XML document. > It works for simple objects, but when I have a bidirectional reference, it is unable to .replicate() the pair of objects, even if I try to commit() them all in the same transaction. > I have created a simple model to reproduce this. > Mapping document: > <hibernate-mapping > package="data"> > <class name="Foo" > table="foo" > > > <id name="id" > node="@id" > type="string" > unsaved-value="null" > column="foo_id" > > <generator class="uuid" /> > </id> > <property > name="prop1" > column="prop1" > type="string" > /> > <many-to-one > name="bar" > column="bar_id" > class="Bar" > not-null="false" > embed-xml="false" > /> > <property > name="index" > column="foo_index" > type="int" > update="true" > /> > </class> > <class name="Bar" > table="bar" > > > <id name="id" > node="@id" > type="string" > unsaved-value="null" > column="bar_id" > > <generator class="uuid" /> > </id> > <list > name="foos" > node="foos" > embed-xml="true" > inverse="true" > lazy="false"> > <key column="bar_id"/> > <list-index column="foo_index"/> > <one-to-many > class="Foo" > embed-xml="false" > node="foo" > /> > </list> > </class> > </hibernate-mapping> > Reconstitution code: > try > { > SAXReader reader = new SAXReader(); > Document doc = reader.read(new File("content.xml")); > Session session = currentSession(); > Session s = session.getSession(EntityMode.DOM4J); > Transaction txn = s.beginTransaction(); > { > List elems = doc.getRootElement().elements(); > Iterator it = elems.iterator(); > while(it.hasNext()) > { > Element e = (Element)it.next(); > log.debug(e.getName()); > if(e.getName().equals("Foo")) > s.replicate("data.Foo",e, ReplicationMode.IGNORE); > if(e.getName().equals("Bar")) > s.replicate("data.Bar",e, ReplicationMode.IGNORE); > } > } > txn.commit(); > } > catch(DocumentException e) > { > log.error(e); > } > Here is the stack trace: > 150 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Cannot add or update a child row: a foreign key constraint fails > 291 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session > org.hibernate.exception.ConstraintViolationException: could not insert: [data.Foo] > at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:74) > at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) > at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1869) > at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2200) > at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:46) > at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) > at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223) > at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136) > at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274) > at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) > at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730) > at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:329) > at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) > at Test.reconstitute(Test.java:69) > at Test.main(Test.java:40) > 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) > Caused by: java.sql.SQLException: Cannot add or update a child row: a foreign key constraint fails > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531) > at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1366) > at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:952) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1974) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1897) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1758) > at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22) > at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1853) > ... 17 more > Exception in thread "main" org.hibernate.exception.ConstraintViolationException: could not insert: [data.Foo] > at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:74) > at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) > at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1869) > at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2200) > at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:46) > at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) > at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223) > at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136) > at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274) > at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) > at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730) > at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:329) > at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) > at Test.reconstitute(Test.java:69) > at Test.main(Test.java:40) > And finally, here is the XML document I am attempting to reconstitute: > <root> > <Foo id="402881e4045ce90c01045ce90f950002"> > <prop1>abcd</prop1> > <bar>402881e4045ce90c01045ce90f770001</bar> > <index>0</index> > </Foo> > <Foo id="402881e4045ce90c01045ce90f9f0003"> > <prop1>456</prop1> > <bar>402881e4045ce90c01045ce90f770001</bar> > <index>1</index> > </Foo> > <Bar id="402881e4045ce90c01045ce90f770001"> > <foos> > <foo>402881e4045ce90c01045ce90f950002</foo> > <foo>402881e4045ce90c01045ce90f9f0003</foo> > </foos> > </Bar> > </root> -- 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: Steve E. (JIRA) <no...@at...> - 2006-06-28 16:46:20
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1217?page=all ] Steve Ebersole updated HHH-1217: -------------------------------- Fix Version: 3.2.2 (was: 3.2.0.cr3) > Problems loading lists of scalar values via EntityMode.DOM4J > ------------------------------------------------------------ > > Key: HHH-1217 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1217 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.0.5 > Environment: HIbernate 3.0.5, MySql 4.10 (Innodb), Windows XP > Reporter: Patrick Casey > Fix For: 3.2.2 > > > Mappings which contain lists of scalar values (as opposed to lists of mapped objects) throw NPEs when you try to load them via a DOM4J session. > **The Mapping: > <class name="metadata.MetaFormDescriptor" table="metaform"> > <cache usage="read-write" /> > <id name="id" type="string" length="32"> > <column name="id" length="32" not-null="true"/> > <generator class="uuid.hex"/> > </id> > <property name="objectClass" column="objectclass" type="string"/> > <many-to-one name="user" class="core.User" embed-xml="false"> > <column name="user_id" length="32"></column> > </many-to-one> > <list name="listA" table="mfa" fetch="join" cascade="all-delete-orphan" embed-xml="false"> > <key column="form_id" /> > <index column="sequence" /> > <element type="string" column="encoded"/> > </list> > <list name="listB" table="mfb" fetch="join" cascade="all-delete-orphan" embed-xml="false"> > <key column="form_id" /> > <index column="sequence" /> > <element type="string" column="encoded"/> > </list> > <list name="listC" table="mfc" fetch="join" cascade="all-delete-orphan" embed-xml="false"> > <key column="form_id" /> > <index column="sequence" /> > <element type="string" column="encoded"/> > </list> > </class> > **The Code that Loads it: > Session sxml = snormal.getSession(EntityMode.DOM4J); > sxml.setFlushMode(FlushMode.NEVER); > List l = sxml.createQuery("from " + MetaFormDescriptor.class.getCanonicalName()).list(); > ** The Dump you get: > Exception in thread "main" java.lang.NullPointerException > at org.dom4j.tree.AbstractElement.addElement(AbstractElement.java:1169) > at org.hibernate.collection.PersistentIndexedElementHolder.readFrom(PersistentIndexedElementHolder.java:135) > at org.hibernate.loader.Loader.readCollectionElement(Loader.java:674) > at org.hibernate.loader.Loader.readCollectionElements(Loader.java:370) > at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:314) > at org.hibernate.loader.Loader.doQuery(Loader.java:412) > at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218) > at org.hibernate.loader.Loader.loadCollection(Loader.java:1434) > at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:99) > at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:488) > at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) > at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1430) > at org.hibernate.type.CollectionType.getCollection(CollectionType.java:484) > 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:530) > at org.hibernate.loader.Loader.doQuery(Loader.java:436) > 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) > at bootstrap.PrimeMover.unLoadOneFile(PrimeMover.java:41) > at bootstrap.PrimeMover.unLoadSeed(PrimeMover.java:59) > at zzTest.Tester.main(Tester.java:736) -- 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 |