Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problems encountered by JPA inheritance classes in NetBeans 6.1

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report