-
May 9th, 2012, 10:50 AM
#1
PropertyNotFoundException in Hibernate
Hi,
I have defined a POJO class where it has mapped to a table Software
This table has a nullable foreign key swtype_id
So inside the Software.java, I have following;
@Entity
@Table(name="SOFTWARE")
public class Software
{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@Column private Integer swtype_id;
// setter method
// getter method
}
but when I ran the application, it complains following:
javax.el.PropertyNotFoundException: Property 'swtype_id' not found on type Software?
here is the jsp
<c:if test="${! empty SEARCH_RESULTS_KEY}">
<c:forEach var="software" items="${SEARCH_RESULTS_KEY}">
<tr>
<td><c:out value="${software.id}"></c:out></td>
<td><c:out value="${software.swtype_id}"></c:out></td>
.....
however, swtype_id is in Software.java, could anyone help?
-
May 10th, 2012, 12:56 PM
#2
Could you post the code for your controller? I'd like to see how you're putting the Software object into your ModelMap.
-
May 11th, 2012, 10:42 AM
#3
hi,
Somehow I changed the design , instead of declaring private Integer swtype_id , I declared the object which is mapped to another table, and that object has association to this object via swtype_id, and this error is gone after I made the change.
Thanks for reply.
hui
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules