0
에 대한 JPA 클래스를 만드는 방법 나는 복합 기본 키 복합 기본 키
site_Uid --> from Site table
address_Uid --> from Address table
JPA 클래스 아래
와 테이블이 예외를@Entity @IdClass(Site.class)
@Table(name = "site_address")
public class SiteAddress implements Serializable {
private static final long serialVersionUID = 7237095501517057347L;
@Id
@Column(name = "site_uid")
private int siteUid;
@Column(name = "address_uid")
@Id
private int addressUid;
}
사이트 클래스를 던졌습니다 :
@Entity
@Table(name = "site")
public class Site implements Serializable {
private static final long serialVersionUID = 2059474818667179203L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long siteUid;
@Column(name = "party_role_uid")
private int partyRoleUid;
@Column(name = "site_type_cd")
private int siteTypeCd;
@Column(name = "site_name")
private String siteName;
}
오류 :
Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: Unable to find properties (siteTypeCd, siteName, partyRoleUid) in entity annotated with @IdClass:com.enkindle.model.SiteAddress
감사합니다. SiteAddressId 클래스는 Serializable을 구현해야합니다. – Thirumal