onetomany and manytoone

 @OneToMany(fetch = FetchType.EAGER, targetEntity = DocConstraint.class, cascade={CascadeType.REMOVE}, mappedBy = "docid")
 public List<DocConstraint> getConstraintList() {
  return constraintList;
 }
 public void setConstraintList(List<DocConstraint> constraintList) {
  this.constraintList = constraintList;
 }

-------------------------------------------------------------

 @ManyToOne  

@JoinColumn(name = "FAPPPERSON", nullable = true, insertable = true, updatable = true)  

public Access getFappperson() {   return this.fappperson;  }

 public void setFappperson(Access value) {   this.fappperson = value;  }

原文地址:https://www.cnblogs.com/guanghuiqq/p/2751232.html