创建连接表关联对象注释 这就是我做的事情
public class Candidature_FK implements Serializable{
private Long idEtudiant;
private Long idStructure;
...
}
和
@Entity
@Table(名称= “候选资格”) @IdClass(Candidature_FK.class) 公共类Candidature实现Serializable {
public Candidature() {
}
@Id
private Long idEtudiant;
@Id
private Long idStructure;
@ManyToOne(fetch=FetchType.EAGER)
@PrimaryKeyJoinColumn(name="Etudiant",referencedColumnName="id")
private Etudiant etudiant_fk;
@ManyToOne(fetch=FetchType.EAGER)
@PrimaryKeyJoinColumn(name="StrectureAcc",referencedColumnName="id")
private StructureAcc structureAcc_fk;
@Temporal(javax.persistence.TemporalType.DATE)
@Column(name="dateCandidature",nullable=false)
private Date dateCandidature;
但问题是基地得到了这个
IDETUDIANT bigint(20)NO PRI
IDSTRUCTURE bigint(20)NO PRI
dateCandidature日期没有
ETUDIANT_FK_id bigint(20)YES MUL
STRUCTUREACC_FK_id bigint(20)YES MUL
!!!!!!!!
提前谢谢