저는 Play2에서 EBean을 사용하여 다 대다 관계를 만들려고하고 있습니다. EBean이 내 클래스가 등록되지 않았다는 오류를 발생시키는 문제가 있습니다. Heres는 내 매핑 클래스 :JPA와 EBean의 Many to Many
@Entity
public class Booking extends Model {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
//... other fields
}
@Entity
public class Store extends Model {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
//... other fields
}
@Embeddable
public class ComissionId {
@ManyToOne(targetEntity = Booking.class, optional = false)
@PrimaryKeyJoinColumn(name = "booking_id", referencedColumnName = "id")
private Booking booking;
@ManyToOne(targetEntity = Store.class, optional = false)
@PrimaryKeyJoinColumn(name = "store_id", referencedColumnName = "id")
private Store store;
}
@Entity
@AssociationOverrides({
@AssociationOverride(name = "id.booking", joinColumns = @JoinColumn(name = "booking_id")),
@AssociationOverride(name = "id.store", joinColumns = @JoinColumn(name = "store_id"))
})
public class StoreComission extends Model {
@EmbeddedId
private ComissionId id;
@Column(nullable = false)
private double value;
@Column(nullable = false)
private Date date;
}
오류 : 내 application.conf에서
java.lang.RuntimeException:
Error reading annotations for models.ids.ComissionId
Caused by: java.lang.RuntimeException:
Error with association to [class models.Booking] from [models.ids.ComissionId.booking].
Is class models.Booking registered?
나는 ebean.default = 넣었습니다 그래서이 모든 클래스가 바로 등록해야 "모델 *."? (패키지 모델 .ids에서 모델로 ComissionId를 이동하려고 시도했지만 동일한 오류가 발생했습니다.)