I have an Entity class with composite PK as below:
using @Embeddable and @EmbeddedId annotations.
/** The primary key class for the uom_conversion database table. */
@Embeddable
public class UomConversionPK implements Serializable {
private static final long serialVersionUID = 1L;
@Column(name="product_id", insertable=false, updatable=false)
private int productId;
@Column(name="base_uom_id", insertable=false, updatable=false)
private int baseUomId;
@Column(name="to_unit_id", insertable=false, updatable=false)
private int toUnitId;
//getters, setters
}
And the Entity which is using it is:
/** The persistent class for the uom_conversion database table. */
@Entity
@Table(name="uom_conversion")
public class UomConversion implements Serializable {
private static final long serialVersionUID = 1L;
@EmbeddedId
private UomConversionPK id;
}
Here Eclipse is displaying error: "UomConversionPK cannot be resolved to a type"
In another project I'm using Entities with composite PK without any errors.
Now this seems to be a JPA facet problem, wondering why Eclipse is not able to resolve UomConversionPK or am I doing something wrong ?