Issues
- Duplicate Property with AccessType.PROPERTY and MappedSuperclassHHH-9485Resolved issue: HHH-9485Steve Ebersole
- CharacterType.get(ResultSet rs, String name) on zero length StringHHH-7515Resolved issue: HHH-7515
- registerVarcharTypes in MySQL5Dialect creates varchar for up to a length of 65535HHH-6075Resolved issue: HHH-6075Brett Meyer
- misleading exception when the entity it not mappedHHH-6019Resolved issue: HHH-6019
- generate schema update script does not respect default schema and default catalog when querying foreign key contraintsHHH-5918Resolved issue: HHH-5918Former user
- Hibernate increases version on readHHH-5867Resolved issue: HHH-5867Strong Liu
- With hibernate.order_inserts=true Hibernate executes SQL inserts in wrong orderHHH-5454Resolved issue: HHH-5454
- PersistentMap.keySet seems to produce a set containing values rather than keys.HHH-5398Resolved issue: HHH-5398
- Dynamically setting schema name for native queries in hbm fileHHH-5333Resolved issue: HHH-5333Strong Liu
- hql group by on multiple classes generates 1 query by class and can return a wrong number of resultsHHH-5141Resolved issue: HHH-5141
- In the Session.flush method has a lost of perfomance about 50% when flush a large amout of dataHHH-5062Juraci Paixão Kröhling
- EventListenerConfigurator uses Ejb3Configuration but could use AnnotationConfiguration insteadHHH-5052Resolved issue: HHH-5052Emmanuel Bernard
- @TableGenerator throws Unsupported exception - error performing isolated workHHH-5019Resolved issue: HHH-5019
- Using two @ManyToOne in a @Entity generates an errorHHH-4821Resolved issue: HHH-4821
- ClassCastException with parameter as CASE resultsHHH-4700Resolved issue: HHH-4700Steve Ebersole
- Session.load(Class, id) fails with MappingException if entity names mappedHHH-4570Resolved issue: HHH-4570
- Undeterministic behavior on Session.close without commit or rollbackHHH-4518Resolved issue: HHH-4518
- Changes are not properly rollbacked after a bulk operation involving classes that use joined-subclass mappingHHH-4455Resolved issue: HHH-4455
- Stackoverflow exception if Composite id has many to one relationship and fetchMode = EAGERHHH-4436Resolved issue: HHH-4436
- Hibernate adding top 2 when I call stored procedureHHH-4089Resolved issue: HHH-4089
- Need for a new -to-many fetch mode, retrieving children ids only (otherwise L2 cache is poorly used when retrieving collections of cached objects)HHH-4071Resolved issue: HHH-4071
- one-to-one non-lazy loading but Filters Not Applied.HHH-4026Resolved issue: HHH-4026Steve Ebersole
- <join>: <key>: different composite keyHHH-4024
- One-to-one: property-ref: foreign key: composite-idHHH-4014Resolved issue: HHH-4014
- Error in SchemaUpdate using HSQLDialect with BigInteger or BigDecimal primary keys [similar to HHH.3323]HHH-3968Resolved issue: HHH-3968Steve Ebersole
- Foreign key constraint should not be generated when <any> is used as element in a collectionHHH-3889Resolved issue: HHH-3889
- Hibernate proxies Groovy's getMetaClass method breaking proxies when used with GroovyHHH-3870Resolved issue: HHH-3870Vlad Mihalcea
- composite-element with null columns in map is ignoredHHH-3836Resolved issue: HHH-3836
- Error with sql generated for set of subclass A in a peer subclass B.HHH-3752Resolved issue: HHH-3752Former user
- ManyToOneType.isModifiedHHH-3730Resolved issue: HHH-3730
- DB sequence numbers are not unique when using the pooled SequenceStyleGenerator in multiple JVMs with the same DBHHH-3608Resolved issue: HHH-3608Steve Ebersole
- Add setReadOnly(true) method to the Criteria interfaceHHH-3578Resolved issue: HHH-3578Former user
- MultipleHiLoPerTableGenerator can contain stale hi value, generate duplicate IDsHHH-3507Resolved issue: HHH-3507
- Include one ore more SLF4J "adapters"HHH-3486Resolved issue: HHH-3486Steve Ebersole
- Add flag to disable timestamps cache; useful for optimizing environments with only natural ID queriesHHH-3480Resolved issue: HHH-3480
- StandardQueryCache.get() does not handle EntityNotFoundException for natural key lookupsHHH-3478Resolved issue: HHH-3478Former user
- Support not-found="ignore" for <any> mappingsHHH-3475
- Prepared Statement Handling Different Between 3.2.6 and 3.3 SP1HHH-3469Resolved issue: HHH-3469
- Hibernate cannot be built with JDK 1.4, nor with JDK 1.6HHH-3466Resolved issue: HHH-3466Former user
- HQL problem with property-ref (example bidirectional one to one)HHH-3460Resolved issue: HHH-3460
- Allow enhanced.TableGenerator to segment itself per entity as defaultHHH-3454Resolved issue: HHH-3454Steve Ebersole
Duplicate Property with AccessType.PROPERTY and MappedSuperclass
Description
Attachments
caused by
Activity
JohannesMartinMay 3, 2016 at 11:09 AM
Steve's patch applies almost cleanly to Hibernate 4.2.23, so I was able to integrate it into JBoss 7 by backporting it and replacing the bundled version of Hibernate in JBoss with the patched version of Hibernate 4.2.23.
JohannesMartinMay 2, 2016 at 12:01 PM
Steve, I just realized the test case I ran within JBoss was slightly different than the one posted here. I did not specify an AccessType on my entity, and appearently it defaulted to AccessType.FIELD. Also, my error message was different:
java.sql.SQLException: Invalid column index
I can replicate that error message with the attached test case when annotating class B with @Access(AccessType.FIELD).
This might explain, why you were not able to verify that the code worked with older versions of hibernate, it might only have worked with AccessType.FIELD. Luckily, your fix solves both cases, with Hibernate 5.0.9 the test case succeeds with both AccessTypes.
Now my only problem is that I cannot get Hibernate 5 to work within JBoss 7 (class mismatches during startup prevent UserTypes from being applied...).
Steve EbersoleFebruary 23, 2016 at 6:34 PM
Like I said, I was not able to get this to work with annotations using any versions of Hibernate. And I went back pretty far. I went back as far as org.hibernate:hibernate-entitymanager:3.2.0.ga
which is even further back than you use. And in no version I tried did this ever work.
Anyway, I fixed it yesterday. GIve it is a try. The solution is not ideal, but I think it is the best we can do until I get the time to completely revamp annotation binding.
Johannes MartinFebruary 19, 2016 at 7:57 AM
We use the artifacts that came bundled with JBoss 4.2.2. Then manifest of hibernate-entitymanager says:
The one from hibernate3:
hibernate-annotations is:
Steve EbersoleFebruary 17, 2016 at 12:55 AM
For the extends-Entity case.. ah right... because the Subclass sees the column with the same name from the RootClass. Fundamentally its the same issue. In both cases we process the attribute from both the super and sub. The difference is just that we don't model MappedSuperclass "inline" with the PersistentClass hierarchy so that Property literally gets duplicated into each sub (hence the dup Property exception).
We have the following class hierarchy:
entity A extends from B (mapped superclass).
AccessType is PROPERTY.
class A defines a method getTest() which is overriden in class B.
This causes the following exception:
Caused by: org.hibernate.MappingException: Duplicate property mapping of testA found in sample.entities.B
at org.hibernate.mapping.PersistentClass.checkPropertyDuplication(PersistentClass.java:515)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:505)
at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1360)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1851)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:85
the attached zip contain a testcase.