the same problem in Hibernate 3.
I tried to do It also with foreign-key :
Quote:
<one-to-one name="glownyZlozony" foreign-key="mod_gl_zl_id"
class="com.bimki.oo7j.hibernate.om.ZestawZlozony" />
but I always got following error :
Quote:
Hibernate: select modul0_.mod_id as ep_id3_, modul0_1_.ep_typ as ep_typ3_3_, modul0_1_.ep_data as ep_data3_3_, manual1_.man_id as man_id0_, manual1_.man_tytul as man_tytul1_0_, manual1_.man_tekst as man_tekst1_0_, manual1_.man_dlTekstu as man_dlTe4_1_0_, modul2_.mod_id as ep_id1_, modul2_1_.ep_typ as ep_typ3_1_, modul2_1_.ep_data as ep_data3_1_, zestawzloz3_.zz_id as ep_id2_, zestawzloz3_1_.ep_typ as ep_typ3_2_, zestawzloz3_1_.ep_data as ep_data3_2_, zestawzloz3_.mod_id as mod_id9_2_, zestawzloz3_.zz_zzId as zz_zzId9_2_ from Modul modul0_ inner join ElementProjektowy modul0_1_ on modul0_.mod_id=modul0_1_.ep_id left outer join Manual manual1_ on modul0_.mod_id=manual1_.man_id left outer join Modul modul2_ on manual1_.man_id=modul2_.mod_id left outer join ElementProjektowy modul2_1_ on modul2_.mod_id=modul2_1_.ep_id left outer join ZestawZlozony zestawzloz3_ on modul0_.mod_id=zestawzloz3_.zz_id left outer join ElementProjektowy zestawzloz3_1_ on zestawzloz3_.zz_id=zestawzloz3_1_.ep_id where modul0_.mod_id=?
19:37:36,080 WARN PersistenceContext:458 - Narrowing proxy to class com.bimki.oo7j.hibernate.om.ZestawZlozony - this operation breaks ==
org.hibernate.PropertyAccessException: could not set a field value by reflection setter of com.bimki.oo7j.hibernate.om.Modul.glownyZlozony
at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:74)
at org.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:564)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:107)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:428)
at org.hibernate.loader.Loader.doQuery(Loader.java:390)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:195)
what am I doing wrong? Is it possible to have one to one-to-one association between two joined subclasses?
I don't have problems with saving data, but only fetching it... Perhabs some data is not beeing saved?