我正在创建一个Below Java类:
@Entity
@Table(name = "relationshiplist")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Employee.findAll", query = "SELECT r FROM employeeTable r")})
public class GetEmployee implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "pkey")
private Integer pkey;
@Size(max = 12)
private String category;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "relationshipListpkey", fetch = FetchType.LAZY)
private List<categoryList> categoryList;
}
1.
的用途是什么?@GeneratedValue(strategy = GenerationType.IDENTITY)
2. @Basic(optional = false)
3. @OneToMany(cascade=cascadeType.ALL,fetch=FetchType.LAZY,mappedBy="employeelistPkey")
任何人都可以解释。
答案 0 :(得分:0)
您所提出的问题在互联网上的众多文档中广泛提供。在Yahoo / Google上搜索后,您可以轻松自行设计。但是,我给你的参考链接很少,如果你仔细阅读文档,我相信你会自己找到答案。
http://www.objectdb.com/api/java/jpa/annotations/field
http://www.objectdb.com/api/java/jpa/annotations/relationship