Bonjour,
j'ai 2 tables ligne et ligneSib d'une base de donnée Oracle 9i. La table ligneSib a été créer pour ajouter des champs à la table ligne car ligne n'était pas modifiable. Je dois donc lier ces 2 tables avec une relation one-to-one.
voici le fichier ligne.hbm :
Code:
<class lazy="true" name="fr.ggl.dao.cinqme.LigneDm" schema="JP250" table="LIGNE">
<composite-id>
<key-property column="NUMCOM" length="6" name="numcom" type="int"/>
<key-property column="INDEXD" length="1" name="indexd" type="byte"/>
<key-property column="TYPCOM" length="1" name="typcom" type="char"/>
<key-property column="NUMLIG" length="3" name="numlig" type="int"/>
</composite-id>
<one-to-one name="ligneSib" class="fr.ggl.dao.cinqme.LigneSibDm"
constrained="true" />
...
et le fichier ligneSib :
Code:
<class lazy="true" name="fr.ggl.dao.cinqme.LigneSibDm" schema="JP250" table="LIGNE_SIB" >
<composite-id >
<key-property column="NUMCOM" length="6" name="numcom" type="int" />
<key-property column="INDEXD" length="1" name="indexd" type="byte" />
<key-property column="TYPCOM" length="1" name="typcom" type="char" />
<key-property column="NUMLIG" length="3" name="numlig" type="int"/>
</composite-id>
<one-to-one name="Ligne" class="fr.ggl.dao.cinqme.LigneDm" />
...
et voici l'erreur :
Code:
Caused by: org.hibernate.PropertyAccessException: exception getting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) getter of fr.ggl.dao.cinqme.LigneDm.?
at org.hibernate.tuple.PojoComponentTuplizer.getPropertyValues(PojoComponentTuplizer.java:42)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:257)
at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:158)
at org.hibernate.engine.EntityKey.getHashCode(EntityKey.java:68)
at org.hibernate.engine.EntityKey.<init>(EntityKey.java:41)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:69)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:655)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:261)
at org.hibernate.type.EntityType.resolve(EntityType.java:286)
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.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1322)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300)
at fr.ggl.uc.admin.EssaiTypeUCEjbBean.testDivers(EssaiTypeUCEjbBean.java:253)
... 44 more
Caused by: java.lang.ClassCastException: fr.ggl.dao.cinqme.LigneSibDm
at fr.ggl.dao.cinqme.LigneDm$$BulkBeanByCGLIB$$1053f250.getPropertyValues(<generated>)
at net.sf.cglib.beans.BulkBean.getPropertyValues(BulkBean.java:86)
at org.hibernate.tuple.PojoComponentTuplizer.getPropertyValues(PojoComponentTuplizer.java:39)
... 62 more
11:01:51,435 ERROR [LoggingExceptionHandler]
Hibernate version:3.0.5
merci