[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5667) enum type annotation: add portable column type
Dave (JIRA)
noreply at atlassian.com
Fri Oct 15 10:35:47 EDT 2010
enum type annotation: add portable column type
-----------------------------------------------
Key: HHH-5667
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5667
Project: Hibernate Core
Issue Type: Improvement
Components: annotations
Environment: ALL
Reporter: Dave
enum type ordinal values are mapped to integer type column. For most cases, they should be mapped to
byte type, for example, smallint(2) for mysql.
public Fruit {
public enum Color {
RED,
YELLOW
}
@Column(columnDefinition="smallint(2)")
private Color getColor() { ...
}
}
The annotation above is not portable. For an application with more than 100 enum types, an portable annotation for column type is needed. For example,
@Column(equivalentType=Byte.class)
private Color getColor() { ...
}
it says: mapping the enum type is equivalent to mapping a byte type.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list