aspose file tools*
The moose likes Object Relational Mapping and the fly likes  org.hibernate.PropertyAccessException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark " org.hibernate.PropertyAccessException" Watch " org.hibernate.PropertyAccessException" New topic
Author

org.hibernate.PropertyAccessException

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
I have one to many relationship between screen and screenacess.
My hbm files are



screen.java

ScreenAcess.java


And i am calling like this


But i am getting following excpetion:


Please tell me where i am wrong.

Thanks
Reddy Prashanth
Ranch Hand

Joined: Aug 09, 2005
Posts: 61
In your mapping file, ScreenTb class has a one-to-many relation with AccessTb class. But in the SClient.java, you are trying to save string objects in the set instead of
"AccessTb"

When you save screenTB, hibernate also will try to save accessTbs colleaction (cascade effect). But it will fail because , the collection contains Strings instead of our mapped entities (AcccessTb). Try to add AccessTB objects to the set and see.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.hibernate.PropertyAccessException
 
Similar Threads
Error with Hibernate
Mapping Error Hibernate
What is "object is not an instance of declaring class" error in hibernate?
java.sql.SQLException: Cannot add or update a child row: a foreign key constraint fails
ids for this class must be manually assigned before calling save()