[Hibernate-JIRA] Commented: (ANN-344) Base class validations are not over-ridden
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-344?page=co... ]
Emmanuel Bernard commented on ANN-344:
--------------------------------------
yes what I want is an error message between 0 and 20 so basically a validator merge when possible
> Base class validations are not over-ridden
> ------------------------------------------
>
> Key: ANN-344
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-344
> Project: Hibernate Annotations
> Type: Improvement
> Components: validator
> Versions: 3.2.0.cr1
> Environment: hibernate 3.2 cr2
> Reporter: Aseel Abbas
>
>
> When the same validation annotation is applied to an over-riding method in a subclass the expected behaviour is that the validation annotation in the base class is over-ridden. Currently, both validations are executed. This severely limits the usability of the package for domain models where inheritance is used.
> The problem also occurs with over-riding interfaces.
> For example:
> class A {
> @Length (min = 0, max = 32)
> Integer getFoo() {
> return foo;
> }
> }
> class B extends A
> {
> @Length (min = 15, max = 20)
> Integer getFoo() {
> return super.getFoo();
> }
> }
> In this case validating an instance of class B which has a foo value of 100 will result in two error messages: "foo must be between 15 and 20" and "foo must be between 0 and 32".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months
[Hibernate-JIRA] Resolved: (ANN-348) @ManyToOne relation fails when using SINGLE_TABLE @Inheritance for referenced table that also has composite primary key
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-348?page=all ]
Emmanuel Bernard resolved ANN-348:
----------------------------------
Resolution: Incomplete
no feedback, I think the issue comes from the fact that in hibernate @IdClass is the one to annotate, not the entity itself.
There is a specific bug report for that
> @ManyToOne relation fails when using SINGLE_TABLE @Inheritance for referenced table that also has composite primary key
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: ANN-348
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-348
> Project: Hibernate Annotations
> Type: Bug
> Versions: 3.2.0.cr1
> Environment: Hibernate Core 3.2.CR2
> Hibernate Annotations 3.2.0 CR1
> Hibernate EntityManager 3.2.0 CR1
> Reporter: Thomas Risberg
> Attachments: ANN-348-src.zip
>
>
> A @ManyToOne relation fails when using SINGLE_TABLE @Inheritance for referenced table that also has composite primary key.
> I have attached a test case.
> Here is the log output and stack trace:
> 2006-05-26 23:44:48,901 INFO [org.hibernate.ejb.Version] - <Hibernate EntityManager 3.2.0.CR1>
> 2006-05-26 23:44:48,998 INFO [org.hibernate.cfg.annotations.Version] - <Hibernate Annotations 3.2.0.CR1>
> 2006-05-26 23:44:49,022 INFO [org.hibernate.cfg.Environment] - <Hibernate 3.2 cr2>
> 2006-05-26 23:44:49,032 INFO [org.hibernate.cfg.Environment] - <hibernate.properties not found>
> 2006-05-26 23:44:49,041 INFO [org.hibernate.cfg.Environment] - <Bytecode provider name : cglib>
> 2006-05-26 23:44:49,065 INFO [org.hibernate.cfg.Environment] - <using JDK 1.4 java.sql.Timestamp handling>
> 2006-05-26 23:44:49,377 DEBUG [org.hibernate.ejb.Ejb3Configuration] - <Trying to find persistence unit: JPATest>
> 2006-05-26 23:44:49,378 DEBUG [org.hibernate.ejb.Ejb3Configuration] - <Analyse of persistence.xml: file:/Users/trisberg/Projects/JPATest2/classes/META-INF/persistence.xml>
> 2006-05-26 23:44:49,568 DEBUG [org.hibernate.util.DTDEntityResolver] - <trying to resolve system-id [http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd]>
> 2006-05-26 23:44:49,570 DEBUG [org.hibernate.cfg.EJB3DTDEntityResolver] - <recognized EJB3 ORM namespace; attempting to resolve on classpath under org/hibernate/ejb>
> 2006-05-26 23:44:49,619 DEBUG [org.hibernate.cfg.EJB3DTDEntityResolver] - <located [http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd] in classpath>
> 2006-05-26 23:44:49,773 DEBUG [org.hibernate.ejb.packaging.PersistenceXmlLoader] - <Persistent Unit name from persistence.xml: JPATest>
> 2006-05-26 23:44:49,782 DEBUG [org.hibernate.ejb.Ejb3Configuration] - <Detect class: true; detect hbm: true>
> 2006-05-26 23:44:49,795 DEBUG [org.hibernate.ejb.Ejb3Configuration] - <Archive to be processed by hibernate Entity Manager implementation found>
> 2006-05-26 23:44:49,805 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Searching mapped entities in jar/par: file:/Users/trisberg/Projects/JPATest2/classes>
> 2006-05-26 23:44:49,806 DEBUG [org.hibernate.ejb.Ejb3Configuration] - <Persistence unit name: JPATest>
> 2006-05-26 23:44:49,807 DEBUG [org.hibernate.ejb.Ejb3Configuration] - <emname:JPATest metadata: JPATest>
> 2006-05-26 23:44:49,808 FATAL [org.hibernate.ejb.Ejb3Configuration] - <commons-logging.propertiesO-:-Ofalse>
> 2006-05-26 23:44:49,809 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: jpatest.Item>
> 2006-05-26 23:44:50,053 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Java element filter matched for jpatest.Item>
> 2006-05-26 23:44:50,057 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: jpatest.ItemStatus>
> 2006-05-26 23:44:50,069 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Java element filter matched for jpatest.ItemStatus>
> 2006-05-26 23:44:50,070 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: jpatest.ItemStatusPK>
> 2006-05-26 23:44:50,072 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: jpatest.NonTaxableOrderLine>
> 2006-05-26 23:44:50,073 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Java element filter matched for jpatest.NonTaxableOrderLine>
> 2006-05-26 23:44:50,074 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: jpatest.Order>
> 2006-05-26 23:44:50,077 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Java element filter matched for jpatest.Order>
> 2006-05-26 23:44:50,078 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: jpatest.OrderLine>
> 2006-05-26 23:44:50,082 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Java element filter matched for jpatest.OrderLine>
> 2006-05-26 23:44:50,083 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: jpatest.OrderLinePK>
> 2006-05-26 23:44:50,085 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: jpatest.TaxableOrderLine>
> 2006-05-26 23:44:50,088 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Java element filter matched for jpatest.TaxableOrderLine>
> 2006-05-26 23:44:50,089 FATAL [org.hibernate.ejb.Ejb3Configuration] - <log4j.propertiesO-:-Ofalse>
> 2006-05-26 23:44:50,093 FATAL [org.hibernate.ejb.Ejb3Configuration] - <META-INF/persistence.xmlO-:-Ofalse>
> 2006-05-26 23:44:50,094 DEBUG [org.hibernate.ejb.packaging.JarVisitor] - <Filtering: Test>
> 2006-05-26 23:44:50,098 DEBUG [org.hibernate.ejb.Ejb3Configuration] - <Creating Factory: JPATest>
> 2006-05-26 23:44:50,246 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Execute first pass mapping processing>
> 2006-05-26 23:44:50,606 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process hbm files>
> 2006-05-26 23:44:50,608 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <Process annotated classes>
> 2006-05-26 23:44:50,619 INFO [org.hibernate.cfg.AnnotationBinder] - <Binding entity from annotated class: jpatest.Order>
> 2006-05-26 23:44:50,674 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column DTYPE unique false>
> 2006-05-26 23:44:50,703 DEBUG [org.hibernate.cfg.annotations.EntityBinder] - <Import with entity name=Order>
> 2006-05-26 23:44:50,720 INFO [org.hibernate.cfg.annotations.EntityBinder] - <Bind entity jpatest.Order on table ORDERS>
> 2006-05-26 23:44:50,757 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.Order property annotation>
> 2006-05-26 23:44:50,802 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.Order field annotation>
> 2006-05-26 23:44:50,917 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.Order.orderId>
> 2006-05-26 23:44:50,932 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column orderId unique false>
> 2006-05-26 23:44:50,933 DEBUG [org.hibernate.cfg.AnnotationBinder] - <orderId is an id>
> 2006-05-26 23:44:50,938 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for orderId>
> 2006-05-26 23:44:50,952 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property orderId>
> 2006-05-26 23:44:50,999 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading orderId with null>
> 2006-05-26 23:44:50,999 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Bind @Id on orderId>
> 2006-05-26 23:44:51,000 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.Order.ordeDate>
> 2006-05-26 23:44:51,000 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column ordeDate unique false>
> 2006-05-26 23:44:51,001 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property ordeDate with lazy=false>
> 2006-05-26 23:44:51,003 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for ordeDate>
> 2006-05-26 23:44:51,004 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property ordeDate>
> 2006-05-26 23:44:51,004 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading ordeDate with null>
> 2006-05-26 23:44:51,005 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.Order.orderLines>
> 2006-05-26 23:44:51,008 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,009 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column orderLines unique false>
> 2006-05-26 23:44:51,013 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,049 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column element unique false>
> 2006-05-26 23:44:51,051 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column key unique false>
> 2006-05-26 23:44:51,052 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,063 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,064 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,068 DEBUG [org.hibernate.cfg.annotations.CollectionBinder] - <Collection role: jpatest.Order.orderLines>
> 2006-05-26 23:44:51,077 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property orderLines>
> 2006-05-26 23:44:51,078 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading orderLines with none>
> 2006-05-26 23:44:51,082 INFO [org.hibernate.cfg.AnnotationBinder] - <Binding entity from annotated class: jpatest.OrderLine>
> 2006-05-26 23:44:51,083 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column linetype unique false>
> 2006-05-26 23:44:51,084 DEBUG [org.hibernate.cfg.annotations.EntityBinder] - <Import with entity name=OrderLine>
> 2006-05-26 23:44:51,084 INFO [org.hibernate.cfg.annotations.EntityBinder] - <Bind entity jpatest.OrderLine on table OrderLine>
> 2006-05-26 23:44:51,085 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Setting discriminator for entity jpatest.OrderLine>
> 2006-05-26 23:44:51,380 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.OrderLine property annotation>
> 2006-05-26 23:44:51,383 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.OrderLine field annotation>
> 2006-05-26 23:44:51,409 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Binding component with path: jpatest.OrderLine.id>
> 2006-05-26 23:44:51,413 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.OrderLinePK field annotation>
> 2006-05-26 23:44:51,415 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.OrderLinePK.orderId>
> 2006-05-26 23:44:51,416 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column orderId unique false>
> 2006-05-26 23:44:51,417 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property orderId with lazy=false>
> 2006-05-26 23:44:51,417 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for orderId>
> 2006-05-26 23:44:51,417 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property orderId>
> 2006-05-26 23:44:51,418 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading orderId with null>
> 2006-05-26 23:44:51,418 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.OrderLinePK.lineNo>
> 2006-05-26 23:44:51,419 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column lineNo unique false>
> 2006-05-26 23:44:51,419 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property lineNo with lazy=false>
> 2006-05-26 23:44:51,420 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for lineNo>
> 2006-05-26 23:44:51,420 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property lineNo>
> 2006-05-26 23:44:51,420 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading lineNo with null>
> 2006-05-26 23:44:51,421 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Binding component with path: jpatest.OrderLine._identifierMapper>
> 2006-05-26 23:44:51,421 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.OrderLine field annotation>
> 2006-05-26 23:44:51,422 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.OrderLine.orderId>
> 2006-05-26 23:44:51,422 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column orderId unique false>
> 2006-05-26 23:44:51,422 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property orderId with lazy=false>
> 2006-05-26 23:44:51,423 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for orderId>
> 2006-05-26 23:44:51,428 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property orderId>
> 2006-05-26 23:44:51,428 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading orderId with null>
> 2006-05-26 23:44:51,429 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.OrderLine.lineNo>
> 2006-05-26 23:44:51,430 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column lineNo unique false>
> 2006-05-26 23:44:51,431 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property lineNo with lazy=false>
> 2006-05-26 23:44:51,431 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for lineNo>
> 2006-05-26 23:44:51,432 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property lineNo>
> 2006-05-26 23:44:51,432 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading lineNo with null>
> 2006-05-26 23:44:51,432 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.OrderLine.order>
> 2006-05-26 23:44:51,433 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column ORDERID unique false>
> 2006-05-26 23:44:51,433 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column order unique false>
> 2006-05-26 23:44:51,444 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property order>
> 2006-05-26 23:44:51,445 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading order with none>
> 2006-05-26 23:44:51,446 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.OrderLine.itemStati>
> 2006-05-26 23:44:51,446 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,449 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column itemStati unique false>
> 2006-05-26 23:44:51,450 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,450 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column element unique false>
> 2006-05-26 23:44:51,450 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column key unique false>
> 2006-05-26 23:44:51,451 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,451 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,451 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column null unique false>
> 2006-05-26 23:44:51,452 DEBUG [org.hibernate.cfg.annotations.CollectionBinder] - <Collection role: jpatest.OrderLine.itemStati>
> 2006-05-26 23:44:51,452 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property itemStati>
> 2006-05-26 23:44:51,452 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading itemStati with none>
> 2006-05-26 23:44:51,453 INFO [org.hibernate.cfg.AnnotationBinder] - <Binding entity from annotated class: jpatest.TaxableOrderLine>
> 2006-05-26 23:44:51,455 DEBUG [org.hibernate.cfg.annotations.EntityBinder] - <Import with entity name=TaxableOrderLine>
> 2006-05-26 23:44:51,492 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.TaxableOrderLine field annotation>
> 2006-05-26 23:44:51,498 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.TaxableOrderLine.rate>
> 2006-05-26 23:44:51,499 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column rate unique false>
> 2006-05-26 23:44:51,499 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property rate with lazy=false>
> 2006-05-26 23:44:51,500 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for rate>
> 2006-05-26 23:44:51,500 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property rate>
> 2006-05-26 23:44:51,500 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading rate with null>
> 2006-05-26 23:44:51,501 INFO [org.hibernate.cfg.AnnotationBinder] - <Binding entity from annotated class: jpatest.NonTaxableOrderLine>
> 2006-05-26 23:44:51,501 DEBUG [org.hibernate.cfg.annotations.EntityBinder] - <Import with entity name=NonTaxableOrderLine>
> 2006-05-26 23:44:51,502 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.NonTaxableOrderLine field annotation>
> 2006-05-26 23:44:51,503 INFO [org.hibernate.cfg.AnnotationBinder] - <Binding entity from annotated class: jpatest.Item>
> 2006-05-26 23:44:51,503 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column DTYPE unique false>
> 2006-05-26 23:44:51,506 DEBUG [org.hibernate.cfg.annotations.EntityBinder] - <Import with entity name=Item>
> 2006-05-26 23:44:51,507 INFO [org.hibernate.cfg.annotations.EntityBinder] - <Bind entity jpatest.Item on table Item>
> 2006-05-26 23:44:51,507 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.Item property annotation>
> 2006-05-26 23:44:51,508 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.Item field annotation>
> 2006-05-26 23:44:51,512 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.Item.itemId>
> 2006-05-26 23:44:51,513 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column itemId unique false>
> 2006-05-26 23:44:51,513 DEBUG [org.hibernate.cfg.AnnotationBinder] - <itemId is an id>
> 2006-05-26 23:44:51,513 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for itemId>
> 2006-05-26 23:44:51,514 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property itemId>
> 2006-05-26 23:44:51,514 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading itemId with null>
> 2006-05-26 23:44:51,514 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Bind @Id on itemId>
> 2006-05-26 23:44:51,515 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.Item.desccription>
> 2006-05-26 23:44:51,515 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column desccription unique false>
> 2006-05-26 23:44:51,516 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property desccription with lazy=false>
> 2006-05-26 23:44:51,517 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for desccription>
> 2006-05-26 23:44:51,517 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property desccription>
> 2006-05-26 23:44:51,517 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading desccription with null>
> 2006-05-26 23:44:51,518 INFO [org.hibernate.cfg.AnnotationBinder] - <Binding entity from annotated class: jpatest.ItemStatus>
> 2006-05-26 23:44:51,522 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column DTYPE unique false>
> 2006-05-26 23:44:51,525 DEBUG [org.hibernate.cfg.annotations.EntityBinder] - <Import with entity name=ItemStatus>
> 2006-05-26 23:44:51,526 INFO [org.hibernate.cfg.annotations.EntityBinder] - <Bind entity jpatest.ItemStatus on table ItemStatus>
> 2006-05-26 23:44:51,527 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.ItemStatus property annotation>
> 2006-05-26 23:44:51,528 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.ItemStatus field annotation>
> 2006-05-26 23:44:51,544 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Binding component with path: jpatest.ItemStatus.id>
> 2006-05-26 23:44:51,545 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.ItemStatusPK field annotation>
> 2006-05-26 23:44:51,546 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatusPK.orderId>
> 2006-05-26 23:44:51,547 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column orderId unique false>
> 2006-05-26 23:44:51,547 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property orderId with lazy=false>
> 2006-05-26 23:44:51,549 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for orderId>
> 2006-05-26 23:44:51,549 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property orderId>
> 2006-05-26 23:44:51,549 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading orderId with null>
> 2006-05-26 23:44:51,550 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatusPK.lineNo>
> 2006-05-26 23:44:51,550 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column lineNo unique false>
> 2006-05-26 23:44:51,551 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property lineNo with lazy=false>
> 2006-05-26 23:44:51,551 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for lineNo>
> 2006-05-26 23:44:51,551 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property lineNo>
> 2006-05-26 23:44:51,552 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading lineNo with null>
> 2006-05-26 23:44:51,552 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatusPK.statusTime>
> 2006-05-26 23:44:51,552 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column statusTime unique false>
> 2006-05-26 23:44:51,553 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property statusTime with lazy=false>
> 2006-05-26 23:44:51,553 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for statusTime>
> 2006-05-26 23:44:51,554 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property statusTime>
> 2006-05-26 23:44:51,554 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading statusTime with null>
> 2006-05-26 23:44:51,554 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Binding component with path: jpatest.ItemStatus._identifierMapper>
> 2006-05-26 23:44:51,555 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing jpatest.ItemStatus field annotation>
> 2006-05-26 23:44:51,557 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatus.orderId>
> 2006-05-26 23:44:51,558 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column orderId unique false>
> 2006-05-26 23:44:51,558 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property orderId with lazy=false>
> 2006-05-26 23:44:51,558 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for orderId>
> 2006-05-26 23:44:51,559 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property orderId>
> 2006-05-26 23:44:51,559 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading orderId with null>
> 2006-05-26 23:44:51,559 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatus.lineNo>
> 2006-05-26 23:44:51,560 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column lineNo unique false>
> 2006-05-26 23:44:51,570 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property lineNo with lazy=false>
> 2006-05-26 23:44:51,570 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for lineNo>
> 2006-05-26 23:44:51,571 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property lineNo>
> 2006-05-26 23:44:51,571 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading lineNo with null>
> 2006-05-26 23:44:51,572 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatus.statusTime>
> 2006-05-26 23:44:51,572 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column statusTime unique false>
> 2006-05-26 23:44:51,572 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property statusTime with lazy=false>
> 2006-05-26 23:44:51,573 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for statusTime>
> 2006-05-26 23:44:51,573 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property statusTime>
> 2006-05-26 23:44:51,574 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading statusTime with null>
> 2006-05-26 23:44:51,574 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatus.orderLine>
> 2006-05-26 23:44:51,575 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column ORDERID unique false>
> 2006-05-26 23:44:51,577 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column LINENO unique false>
> 2006-05-26 23:44:51,578 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column orderLine unique false>
> 2006-05-26 23:44:51,579 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property orderLine>
> 2006-05-26 23:44:51,579 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading orderLine with none>
> 2006-05-26 23:44:51,579 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatus.item>
> 2006-05-26 23:44:51,580 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column ITEMID unique false>
> 2006-05-26 23:44:51,581 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column item unique false>
> 2006-05-26 23:44:51,670 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property item>
> 2006-05-26 23:44:51,671 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading item with none>
> 2006-05-26 23:44:51,671 DEBUG [org.hibernate.cfg.AnnotationBinder] - <Processing annotations of jpatest.ItemStatus.quantity>
> 2006-05-26 23:44:51,672 DEBUG [org.hibernate.cfg.Ejb3Column] - <Binding column quantity unique false>
> 2006-05-26 23:44:51,672 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <binding property quantity with lazy=false>
> 2006-05-26 23:44:51,672 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] - <building SimpleValue for quantity>
> 2006-05-26 23:44:51,673 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Building property quantity>
> 2006-05-26 23:44:51,673 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] - <Cascading quantity with null>
> 2006-05-26 23:44:51,673 DEBUG [org.hibernate.cfg.AnnotationConfiguration] - <processing manytoone fk mappings>
> Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.AnnotationException: Column name orderId of jpatest.OrderLine not found in JoinColumns.referencedColumnName
> 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 Test.main(Test.java:17)
> Caused by: org.hibernate.AnnotationException: Column name orderId of jpatest.OrderLine not found in JoinColumns.referencedColumnName
> at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:297)
> at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:45)
> at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:288)
> 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)
> ... 3 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months
[Hibernate-JIRA] Resolved: (ANN-376) @SecondaryTable together with @Inheritance(strategy=InheritanceType.JOINED) fails
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-376?page=all ]
Emmanuel Bernard resolved ANN-376:
----------------------------------
Resolution: Duplicate
ANN-376
> @SecondaryTable together with @Inheritance(strategy=InheritanceType.JOINED) fails
> ---------------------------------------------------------------------------------
>
> Key: ANN-376
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-376
> Project: Hibernate Annotations
> Type: Bug
> Versions: 3.2.0.cr1
> Environment: Hibernate 3.2.0.cr2 included in JBoss4.0.4GA, MySQL 5
> Reporter: André J. Rogger
>
>
> Persister of JoinedSubclassEntity fails together with secondary table annotation (the other inheritence strategies are working fine).
> For example with the following two classes A and B:
> [A.java]
> @Entity
> @SecondaryTable(name="C")
> @Inheritance(strategy=InheritanceType.JOINED)
> public class A {
> @Id
> long id;
>
> @Column(table="C")
> String fieldInC;
> }
> [B.java]
> @Entity
> public class B extends A {
> String fieldOfB;
> }
> the deployment produces the following error:
> org.hibernate.AssertionFailure: Table C not found
> at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:444)
> at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:225)
> at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months
[Hibernate-JIRA] Updated: (ANN-374) Map - OneToMany w or w/o join table creates bad sql
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-374?page=all ]
Emmanuel Bernard updated ANN-374:
---------------------------------
Fix Version: 3.2.0
> 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
> 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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months
[Hibernate-JIRA] Resolved: (ANN-380) Need more info about error place
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-380?page=all ]
Emmanuel Bernard resolved ANN-380:
----------------------------------
Resolution: Incomplete
no additional information provides
> Need more info about error place
> --------------------------------
>
> Key: ANN-380
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-380
> Project: Hibernate Annotations
> Type: Improvement
> Components: binder
> Versions: 3.2.0.cr1
> Environment: Version Hibernate EntityManager 3.2.0.CR1
> Version Hibernate Annotations 3.2.0.CR1
> Environment Hibernate 3.2 cr2
> Reporter: Sergey Vladimirov
>
>
> Need more info where error occured. For example, query name.
> java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
> \-[IDENT] IdentNode: 'user' {originalText=user}
> at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:145)
> at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:714)
> at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:538)
> at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
> at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
> at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
> at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
> at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
> at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
> at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
> at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
> at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
> at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:400)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:351)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
> at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:630)
> at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:759)
> at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:626)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 4 months