I get this exception
Code:
org.hibernate.AnnotationException: Property of @IdClass not found in entity br.mil.mar.casnav.jc3iedm.status.AbstractObjectItemStatus: objItem
at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:2407)
at org.hibernate.cfg.AnnotationBinder.bindIdClass(AnnotationBinder.java:2520)
at org.hibernate.cfg.AnnotationBinder.mapAsIdClass(AnnotationBinder.java:874)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:692)
...
when I use @Mappedsuperclass and @IdClass together like this:
Code:
@MappedSuperclass
public abstract class AbstractObjectItemAssociation implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@ManyToOne
@JoinColumn(name = "obj_item_id")
@JsonSerialize(using = JsonRelationSerializer.class)
@JsonDeserialize(using = JsonObjectItemRelationResolver.class)
private ObjectItem objItem;
public void setObjItem(ObjectItem objItem) {
this.objItem = objItem;
}
public ObjectItem getObjItem() {
return objItem;
}
}
@Entity(name = "obj_item_stat")
@Table(schema = Config.SCHEMA_JC3)
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "cat_code", discriminatorType = DiscriminatorType.STRING, length = 6)
@IdClass(AbstractObjectItemStatusId.class)
public abstract class AbstractObjectItemStatus extends AbstractObjectItemAssociation implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@NotNull
@Digits(integer = 20, fraction = 0)
@Column(name = "obj_item_stat_ix")
private BigInteger ix;
@NotNull
@CatCode
@Column(name = "cat_code")
private String objectItemStatusCategoryCode;
...
}
public class AbstractObjectItemStatusId implements Serializable
{
private static final long serialVersionUID = 1L;
private BigInteger objItem;
private BigInteger ix;
public AbstractObjectItemStatusId() {
}
...
}
Someone could help me to fix it?
Thx!