Hi out there, 

it is really difficult to create a useful and short subject for my problem, so 
I just named the important things and explain here. 
I have an EJB3 application on JBoss 4.0.3 with Entity Beans (persisted by 
Hibernate). All of my Entity Beans have one parent Entity Bean that has various 
attributes that every table of our database has - among others the primary key 
"id". Now I have one Entity Bean (MenuXForm) that has a relation to "Menu" and 
"Form" Entities (ManyToOne). When selecting MenuXForm entities I get an 
exception when there is for example a Menu Entity with id = 12 selected, and 
there already exists a Form Entity with id = 12 in the cache. Then Hibernate 
tries to set the existing Form Entity as a Menu Entity. The exception that 
occurs is a 
org.hibernate.PropertyAccessException: exception setting property value with 
CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter 
of de.weltbild.wbmsadmin.j2ee.entities.MenuXForm.setMenu

I think Hibernate sees that both Menu und Form are EntityObjects (superclass 
defining the primary key) and therefore gives back the first EntityObject with 
the searched primary key. It does not look if the type of the object is right. 

Is this an error in Hibernate or isn't it possible to have one superclass for 
all entities defining pk and other attributes? From the OO view I would say I'm 
right because my Form Object "is a" Entity Object. 

Could you please help me further? Thank you very much!

Yours, Peter 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3916922#3916922

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3916922


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to