Hi I'm trying to persista a Collection of Enums in string format and I
can't seem to find much information on how to do this.
There were some things that said it defaults to String but when I
generated the tables (using the MappingToolTask) it comes out as a number
column.
i.e.
public enum Role {A, B, C}
...
@ManyToMany(fetch=FetchType.EAGER)
@ContainerTable(name="UserRole",
joincolum...@xjoincolumn(name="userId", referencedColumnName="id"),
joinforeignk...@foreignkey)
@ElementJoinColumn(name="Role")
private Set<Role> roles=new HashSet<Role>();
generates
CREATE TABLE UserRole (userId INTEGER, Role SMALLINT) TYPE = innodb;
Is there a way to do the equivalent of
@Enumerated(EnumType.String) on collections?
--
Ted Leung
[email protected]
I can speak Canadian, American, Australian, and little English.