-->
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.  [ 1 post ] 
Author Message
 Post subject: Annotation to use with char(2)?
PostPosted: Sun Nov 02, 2008 9:37 pm 
Newbie

Joined: Sun Nov 02, 2008 8:14 pm
Posts: 1
I’m trying to Seam generate-model an Oracle database with a column char(2). The resulting class contains:

Code:
   @Column(name = "STATE_CODE", length = 2)
   @Length(max = 2)
   public String getStateCode() {
      return this.stateCode;
   }


But when I deploy I the JBoss server log shows:

Code:
2008-11-02 19:08:30,033 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:ear=sls.ear,unitName=sls
javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: STATE_CODE, expected: varchar2(2)
   at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
   at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
   at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)



I’m guessing I need something like

Code:
   @Column(name = "STATE_CODE", columnDefinition = "char(2)", length = 2)


But this doesn’t work. What do I do next?

I'm using Seam 2.0.2, JBoss 4.2.3 and Oracle 10gR2


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

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.