This is my entity configurations..
Code:
@Entity
@Table(name = "VSS_FILE_HEADER")
public class PatchVO implements Serializable{
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="my_entity_seq_gen")
@SequenceGenerator(name="my_entity_seq_gen", sequenceName="VSS_FILE_HEADER_SEQ")
@Column(name="VSS_ID")
private Long vssId;
@Column(name="FILE_NAME")
private String fileName;
@OneToMany(cascade=CascadeType.ALL)
@JoinColumn(name = "VSS_ID",insertable=false,updatable=false,nullable=false)
private List <VssArtifactVO> vssArtifacts;
--------------------------------------------------------------------
@Entity
@Table(name = "VSS_ARTIFACTS")
public class VssArtifactVO implements Serializable {
@EmbeddedId
private CompoundKey id;
@Transient
private Long artifactSeq;
@Embeddable
public static class CompoundKey implements Serializable{
@Column(name="VSS_ID")
private Long vssId;
@Column(name="ART_TYPE_ID")
private Integer artifactTypeId;
@Column(name="ARTIFACT_NAME")
private String artifactName;
public CompoundKey() {}
public CompoundKey(Long vssId,Integer artifactTypeId,String artifactName) {
this.vssId=vssId;
this.artifactTypeId=artifactTypeId;
this.artifactName=artifactName;
}
}
}
But i am getting the following error
Repeated column in mapping for entity: om.gov.moh.phs.patch.vo.VssArtifactVO column: VSS_ID (should be mapped with insert="false" update="false");
How can I solve this issue?.. I cannot give VSS_ID as insertable=false,updatable=false because this is a composit key in VssArtifactVO ..
Please help...
Thanx in Advnce
Abdul Jaleel C