Hi,
I have a many to many relation with a join table that have additional columns and a composed PK.
Why do I get a
Code:
org.hibernate.HibernateException: Missing column: developer_DEVELOPER_ID in ESVPROTO.PR3_DEVELOPER_ASSIGNMENT
Exception ?
The column name and referencedColumName are set.
The Classes looks as follows:
Developer Class: Code:
@Entity
@Table( name = "PR3_DEVELOPER" )
public class Developer extends BaseVersionedEntity
{
....
@OneToMany( cascade = CascadeType.REMOVE, fetch = FetchType.LAZY, mappedBy = "developer" )
private Set<DeveloperAssignment> developerAssignment = new HashSet<DeveloperAssignment>();
DeveloperAssignment Class (join class):Code:
@Entity
@Table( name = "PR3_DEVELOPER_ASSIGNMENT" )
public class DeveloperAssignment extends BaseRelationEntity<StoryAssignment, Developer, DeveloperAssignmentPK>
{
private static final long serialVersionUID = 1L;
@EmbeddedId
private DeveloperAssignmentPK primaryKey;
@SuppressWarnings( "unused" )
@ManyToOne( optional = false )
@PrimaryKeyJoinColumn( name = "STORY_ASSIGNMENT_ID", referencedColumnName = "STORY_ASSIGNMENT_ID" )
private StoryAssignment storyAssignment;
@SuppressWarnings( "unused" )
@ManyToOne( optional = false )
@PrimaryKeyJoinColumn( name = "DEVELOPER_ID", referencedColumnName = "DEVELOPER_ID" )
private Developer developer;
The DeveloperAssignmentPK class:
Code:
@Embeddable
public class DeveloperAssignmentPK extends BasePrimaryKey
{
@Column( name = "STORY_ASSIGNMENT_ID" )
private Integer storyAssignmentId;
@Column( name = "DEVELOPER_ID" )
private Integer developerId;
...