How to solve the problems encountered by JPA inheritance classes in NetBeans 6.1
This article will explain in detail how to solve the problems encountered by JPA inheritance classes in NetBeans 6.1. The content of the article is of high quality, so Xiaobian shares it with you as a reference. I hope that after reading this article, you will have a certain understanding of relevant knowledge.
I ran into problems doing a JPA exercise on inherited classes with NetBeans 6.1.
When you get to step 10 ('Generate JavaServer Faces (JSF) pages from entity classes'), you get the error: "mypackage.student: Could not find Id property'.
This issue is a Bug in NetBeans 6.1 and has been fixed in NetBeans 6.5.
If you want to complete in NetBeans 6.1, you can bypass this issue by following these steps:
1. Student.java, add and encapsulate a field and set it to key. The code is as follows:
@Id@GeneratedValue(strategy = GenerationType.AUTO)private Long studentid;public Long getStudentid() {return studentid;}public void setStudentid(Long studentid) {this.studentid = studentid;}
2. Generating JSF Pages from Entity Classes
3. Modify Student.java to remove the above new code.
About how to solve the JPA inheritance class in NetBeans 6.1 encountered problems shared here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.