0
요청한 문자열이 아닌 데이터베이스에 정수를 저장합니다.이 JPA 열거 형이 작동하지 않는 이유는 무엇입니까?
다음은 열거 형을 포함하는 클래스입니다. 나는이 일을해야 알
public enum DocumentType {
policy,procedure,webbookmark,newsrelease,collectionLetter,whitepaper,busform,
newsarticle ;
}
: 여기
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class Document extends BaseModel {
private String title = new String();
private String description = new String();
**@Enumerated(EnumType.STRING)
private DocumentType documentType;**
@Embedded
private DocumentImage documentImage;
// if document should be displayed or published on the web site.
private Boolean published = new Boolean(false);
public Document(DocumentType docType) {
super();
documentType = docType;
setDocumentImage(new DocumentImage());
}
}
및
는 열거 클래스입니다. 어떤 아이디어?
당신이 말한대로, 잘 작동해야합니다. 다른 JPA 제공 업체 (예 : DataNucleus)에서도 정상적으로 작동합니다. – DataNucleus
괜찮아 보입니다. - Dialect가 올바르게 구성되어 있고 올바른 패키지의 열거 형 주석입니까? – Ralph