@Embeddable Class Certification からすべての列を選択します。しかし、私はそれを選択することはできません。Embeddable クラスを選択するにはどうすればよいですか。
@Entity
public class Department implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
@ElementCollection
@CollectionTable(name = "Certification", joinColumns = {@JoinColumn(name="user_id")})
private List<Certification> certifications = new ArrayList<Certification>();
public List<Certification> getCertifications() {
return certifications;
}
public void setCertifications(List<Certification> certifications) {
this.certifications = certifications;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
.....
@Embeddable クラス認定
@Embeddable
public class Certification{
private String name;
private String certArt;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCertArt() {
return certArt;
}
public void setCertArt(String certArt) {
this.certArt = certArt;
}
......
ResultService を実行すると、次の例外が発生します。
原因: java.lang.IllegalArgumentException: EntityManager でクエリを作成中に例外が発生しました: 例外の説明: クエリのコンパイル中にエラーが発生しました [証明書 c から c を選択]。不明なエンティティ タイプ [証明書]。
@Embeddable クラスを選択するにはどうすればよいですか?