-
Bug
-
Resolution: Duplicate
-
Major
-
EJB 3.0 Beta 1
-
None
-
None
I've got the following entity bean:
[code]
@Entity
@Table(name = "class")
public class JClass implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private Long key;
private Long version;
public void setKey(Long key)
{ this.key = key; } @Id(generate=GeneratorType.AUTO)
@Column(name="id")
public Long getKey()
@Version
@Column(name="version")
public Long getVersion()
public void setVersion(Long version)
{ this.version = version; }public void setScope(Scope scope)
{ this.scope = scope; } @Column(name="scope")
public Scope getScope()
}
[/code]
where Scope is an enum :
[code]
import java.io.Serializable;
public enum Scope implements Serializable
{ PUBLIC, PROTECTED, PRIVATE; }[/code]
My persistence.xml contains the following:
[code]
<entity-manager>
<name>JavaLibraryEntityManager</name>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/JavaLibraryds</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
</properties>
</entity-manager>
[/code]
When i deploy the software it creates the class table for me.
According to chapter 2.2.2.1 (Hibernate annotations reference documentation) the database column can be a string type or an int type (storing the ordinal).
In this case JBoss creates a int(11) column for me.
But when i try to persist an object i get the following error:
SQL Type not supported for Enums: 1