@Entity @Inheritance(strategy = InheritanceType.JOINED) @Table(name = "tbp_user") public class User extends EnterpriseObject {
@Entity @Table(name = "tbp_student") public class Student extends User {
http://javahello.i.sohu.com/blog/view/112906200.htm http://www.jdon.com/32923 参考下,也许能解决你的问题
你说的是父类引用指向子类 User u=new Student();
你听过父类转换为子类吗?儿子能让他爹喊他爹吗?
67,550
社区成员
225,863
社区内容
加载中
试试用AI创作助手写篇文章吧