Topic: 如何通过hibernate把数据库的表映射成pojo

  Print this page

1.如何通过hibernate把数据库的表映射成pojo Copy to clipboard
Posted by: landyou
Posted on: 2006-08-15 00:24

请问 如何通过hibernate把数据库的表映射成pojo?

2.Re:如何通过hibernate把数据库的表映射成pojo [Re: landyou] Copy to clipboard
Posted by: ye163com
Posted on: 2006-09-15 17:37

通过数据库生成POJO?
还是POJO通过HIBERNATE映射生成数据库表。。。
我用过
@Entity
@Table(name = "UserTable")
public class user implements serializable
{
private static final long serialVersionUID = 3L;
private Integer userId;
private String userName;
@Id
@GeneratedValue
public Integer getUserId()
{
return userId;
}
public void setUserId(Integer userId)
{
this.userId=userId;
}
@Column(name = "UserName")
public String getUserName()
{
return userName;
}
public void setUserName(String userName)
{
this.userName=userName;
}

}
这样可以在数据库中生成一张UserTable表与此实体bean相对应。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923