Persistence problems with Object relational mappings

Description

My web application uses
JSF 1.1.01 as Presentation Layer
Spring 1.2.6 as Business Layer
Hibernate 3.12 as Persistence Layer

The JSF form has

  • One drop down which automatically populates the remaining textfields on the form
    -One h:selectManyListbox which populates all the possible user Roles

  • Add /Remove h:commandButtons

  • One h:selectManyListbox which gets populated with selected user roles on click of Add button. This will work only if i set the scope to session in faces-config.xml

I have two POJOS i.e. DeviceType and Role. The relationship is uni-directional and Many-To-Many. That means DeviceType can have multiple Roles.

Expected Results :

If i persist DeviceType object then i expect the following insert statements to happen
1)insert into DeviceType(Id, Name, Desc) values(?,?,?)
2)insert into DeviceType_Roles(DeviceType_Id,Role_Id) values(?,?)

Please Note DeviceType object is associated with set of Roles

Observed Results :

2007-01-21 20:53:26,796 ERROR [org.hibernate.property.BasicPropertyAccessor] - <IllegalArgumentException in class: test.Role, getter method of property: id>
2007-01-21 20:53:26,796 WARN [test.TestBean] - <IllegalArgumentException occurred calling getter of test.Role.id; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of test.Role.id>

Here is my posting on Hibernate Forums : http://forum.hibernate.org/viewtopic...981&highlight=

Please Note I have read the Hibernate Documentation extensively & strictly followed the example . Nothing helps hence looks like its a Bug with Hibernate 3.1.2. Please note i am using hibernate 3.1.jar and hibernate-annotations.jar under Spring 1.2 ORM/DAO/Hibernate framework

Environment

HSQLDB, MyEclipse 5.0, JSF , Spring

Activity

Show:
Christian Bauer
January 22, 2007, 9:19 PM

Stay on the forum if you have usage questions.

bansi
January 22, 2007, 10:02 PM

Hi Christian
Thanks for quick response. So will you take few minutes in looking at my posting on the Hibernate Forum (http://forum.hibernate.org/viewtopic...981&highlight=) as i didn't recieved any suggestions/pointers till now and i am running out of time on my project. Wondering is there any Hibernate Support?

Regards
Bansi

Christian Bauer
January 22, 2007, 10:19 PM
bansi
January 22, 2007, 10:39 PM

Thanks for the link. I will take it with my team. In the meantime i really appreciate your time in looking at my posting on the Hibernate Forum (http://forum.hibernate.org/viewtopic...981&highlight=).

Please note right before persisting the Object i am printing its contents and found it to be perfectly alright. So not sure from where exactly the Illegal Argument xception is coming from. I know from the error its from the Id of associated object. So i 100% believe its something to do with the API
hibernateTemplate.save(Object obj) hence posting on this forum

Regards
Bansi

Steve Ebersole
March 21, 2011, 7:04 PM

Bulk closing stale resolved issues

Rejected

Assignee

Unassigned

Reporter

bansi

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Blocker
Configure