WebSphere v8 を実行しており、Java EE 6 環境で JPA パーシスタンスを使用しています。
特定のエンティティを処理するコードを実行しようとすると、次の例外が発生します。
javax.ejb.EJBTransactionRolledbackException: ネストされた例外: javax.ejb.EJBTransactionRolledbackException: ネストされた例外: javax.ejb.EJBException: ネストされた例外を参照してください。ネストされた例外は次のとおりです: org.apache.openjpa.persistence.ArgumentException: タイプ「クラス au.com.combined.domain.changeroutine.ChangeRoutineConsumedPK」は拡張されていません。
ただし、この記事では、私のクラスは実行時に既に拡張されている必要があると述べています。ChangeRoutineConsumedPK は埋め込み可能なクラスです。誰かが私のクラスを見て、私が間違っていることを教えてもらえますか? ありがとうございました。
ChangeRoutineConsumed:
@Entity
@Table(name = ChangeRoutineConsumed.TABLE_NAME)
public class ChangeRoutineConsumed extends BaseBusinessObject {
public static final String TABLE_NAME = "COCHANGEROUTINECONSUMED";
@EmbeddedId
private ChangeRoutineConsumedPK id;
protected ChangeRoutineConsumed() {
super();
}
public ChangeRoutineConsumed(@Min(1) long changeRoutineId, @NotNull String consumedBy){
this(new ChangeRoutineConsumedPK(changeRoutineId, consumedBy));
}
public ChangeRoutineConsumed(@NotNull ChangeRoutineConsumedPK id){
super();
setId(id);
}
...
public int hashCode(){...};
public boolean equals(Object obj){...}
}
ChangeRoutineConsumedPK:
@Embeddable
public class ChangeRoutineConsumedPK {
@Column
private long changeRoutineId;
@Column
private String consumedBy;
public ChangeRoutineConsumedPK(){}
public ChangeRoutineConsumedPK(long changeRoutineId, String consumedBy) {
setChangeRoutineId(changeRoutineId);
setConsumedBy(consumedBy);
}
...
public int hashCode() {...}
public boolean equals(Object obj) {...}
}