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