2010-09-08 4 views

Répondre

0

Vous n'avez pas besoin de spécifier l'annotation @JoinColumn du tout:

@Entity 
public class PrimaryEntity { 

    @OneToMany(mappedBy = "primaryEntity") 
    public List<RelatedEntity> getRelatedEntities() { 
     return relatedEntities; 
    } 

} 

@Entity 
public class RelatedEntity { 

    @ManyToOne 
    public PrimaryEntity getPrimaryEntity() { 
     return primaryEntity; 
    } 

} 
Questions connexes