Following this link
I would like to use OneToMany instead ManyToMany annotation, having middle class with composite key in it using Ebean. I have this error:
java.lang.RuntimeException: Error reading annotations for models.SoftwareTagPk
This is my SoftwareTagPk class:
@Embeddable
public class SoftwareTagPk implements Serializable {
@ManyToOne
private Tag tag;
@ManyToOne
private Software software;
...
}
And SoftwareTag class:
@Entity
public class SoftwareTag extends Model {
@EmbeddedId
private SoftwareTagPk pk = new SoftwareTagPk();
@Transient
public Tag getTag() {
return pk.getTag();
}
public void setTag(Tag aTag) {
pk.setTag(aTag);
}
@Transient
public Software getSoftware() {
return pk.getSoftware();
}
public void setSoftware(Software aSoftware) {
pk.setSoftware(aSoftware);
}
}
Also in logs:
Error with association to [class models.Tag] from [models.SoftwareTagPk.tag]. Is class models.Tag registered?
How to fix it?