Results 1 to 3 of 3

Thread: PropertyNotFoundException in Hibernate

  1. #1
    Join Date
    Apr 2012
    Posts
    8

    Cool 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?

  2. #2

    Default

    Could you post the code for your controller? I'd like to see how you're putting the Software object into your ModelMap.

  3. #3
    Join Date
    Apr 2012
    Posts
    8

    Default

    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
  •