Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.2
-
Fix Version/s: 2.3-M2
-
Component/s: Persistence
-
Labels:None
-
Testcase included:yes
Description
Hi,
I am trying to integrate an entity with hibernate mapping into a grails application. If there is a field mapped with access=field without corresponding getter / setter methods I get the following exception while trying to save the entity. This used to work in grails 1.1.
Invalid property 'title' of bean class [com.tenxperts.Book]: Bean property 'title' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
org.springframework.beans.NotReadablePropertyException: Invalid property 'title' of bean class [com.tenxperts.Book]: Bean property 'title' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at com.tenxperts.BookTests.testSaveBook(BookTests.groovy:15)
at junit.framework.Test$run.call(Unknown Source)
The following is the class
package com.tenxperts;
public class Book {
private Long id;
private String title;
public Long getId()
{ return id; }public void setId(Long id)
{ this.id = id; }}
& hibernate mapping
<hibernate-mapping>
<class name="com.tenxperts.Book"
table="BOOK"
discriminator-value="P">
<id name="id" column="ID"><generator class="native" /></id>
<property name="title" column="TITLE" access="field"/>
</class>
</hibernate-mapping>
The mapping cannot be changed - I am getting this error while using the jbpm plugin - the jbpm hibernate mapping has many instance of the above problem. I have attached a very simple test case that reproduces this issue.
Regards,
Kamal
I am facing the same problem in Grails 1.3.1