Announcement Announcement Module
Collapse
No announcement yet.
PropertyNotFoundException in Hibernate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Could you post the code for your controller? I'd like to see how you're putting the Software object into your ModelMap.

    Comment


    • #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

      Comment

      Working...
      X