|
This is the entity class causing a mapping error:
@Entity
public class Customer implements Serializable {
@ElementCollection(fetch = EAGER)
@CollectionTable(name = "customer_color",
joinColumns = @JoinColumn(name = "customer_fk", nullable = false),
uniqueConstraints = @UniqueConstraint(columnNames = { "customer_fk", "color" }))
@Column(table = "customer_color", name = "color", nullable = false)
private Set<ColorType> colors; ...
Additionally, the enum ColorType has this converter:
@Converter(autoApply = true)
public class ColorTypeConverter implements AttributeConverter<ColorType, String> {...}
However, the definition for the "color" column in e.g. Oracle is NUMBER(10) and not VARCHAR2.
I'll attach a Maven-based testcase for the latest WildFly (containing Hibernate 4.3.0.beta4) and the datasource java:jboss/datasources/ExampleDS, i.e. an in-memory H2 database (see persistence.xml). Just invoke "mvn package jboss-as:deploy" and during deployment the table "customer_color" is created, and the "color" column is of type NUMBER.
|