-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: @Enumerated and @Id
PostPosted: Wed Nov 29, 2006 11:50 am 
Newbie

Joined: Wed Nov 29, 2006 11:38 am
Posts: 5
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 15, 2007 2:03 pm 
Newbie

Joined: Thu Aug 26, 2004 4:21 pm
Posts: 2
i'm running into the same problem. does anyone have a solution? is it possible to have an enumerated primary key?

thanks.

-l


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.