Hi Cameron,
Unfortunately effective date needs to be in the primary key.
This is how Oracle HCM stores historical data.
For the moment i'm this far:
Code:
@Entity
@IdClass(CompanyEffDatePK.class)
@Table(name = "COMPANY")
public class CompanyEffDate implements EffDateInterface
{
// ----- CONSTANTS -----
private static final long serialVersionUID = 6055686640986901623L;
// ----- MEMBERS -----
private String companyId;
private Date effDate;
private String name;
// ----- GETTER -----
/**
* @return the companyId
*/
@Id()
@Column(name="ID")
public String getCompanyId()
{
return companyId;
}
/**
* @return the effDate
*/
@Id()
@Column(name="EFFDT")
public Date getEffDate()
{
return effDate;
}
...
Code:
@Entity
@IdClass(AddressEffDatePK.class)
@Table(name = "COMPANY_ADDRESS")
public class AddressEffDate implements EffDateInterface
{
// ----- CONSTANTS -----
private static final long serialVersionUID = -3827054467502810838L;
// ----- MEMBERS -----
private String addressId;
private Date effDate;
private String companyId;
private String name;
private String street;
// ----- GETTER -----
/**
* @return the addressId
*/
@Id()
@Column(name="ID")
public String getAddressId()
{
return addressId;
}
/**
* @return the effDate
*/
@Id()
@Column(name="EFFDT")
public Date getEffDate()
{
return effDate;
}
/**
* @return the companyId
*/
@Column(name="COMPANY_ID")
public String getCompanyId()
{
return companyId;
}
....
You see I can’t navigate between mappings.
Pieter