Hello,
I would know if I can use @Id with @Enumerated?
I define the table with no technical primary key:
Code:
CREATE TABLE PROCESS_TYPE
(
PROCESS_TYPE_ID VARCHAR2(25 BYTE) NOT NULL,
NAME VARCHAR2(100 BYTE)
)
PROCESS_TYPE_ID is the primary key.
And its mapping:
Code:
@Entity
@Table(name="PROCESS_TYPE")
public class ProcessType implements Serializable {
public enum ProcessEnumType {
NEW_REQUEST,...
}
@Id
@Column(name="PROCESS_TYPE_ID")
@Enumerated(EnumType.STRING)
private ProcessEnumType aurProcessTypeId;
private String name;
...
}
When a mapping to ProcessType object occurs, I've got the exeption:
Code:
11/29/06 4:25:46 PM (I) NullableType.nullSafeGet : could not read column value from result set: AUR1_382_; could not deserialize
11/29/06 4:25:46 PM (S) AbsTransactionInterceptor.handleContextContainerTransaction : Exception (not application exception) in business method
javax.persistence.PersistenceException: org.hibernate.type.SerializationException: could not deserialize
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:56)
What kind of solution do you use to define your referential tables?
Py