I am using a simple enum (EnumType.STRING) and it works quite as expected.
The only things that seems strange to me are:
- the generated column is varchar2(255)
shouldn't the columnlength be only the max. stringlength of my enums? - why are no constraints added for the column?
- is this the way it is meant to be?
- is this just a problem with the oracle dialect?
- is this a feature that can/will be added in the future?
Details:
Oracle10g (10.2.0.1.0)
hibernate 3
Enum:
Code:
public enum WebUserStatus {
REGISTERED,
ACTIVE
}
entity:
Code:
private WebUserStatus status;
@Enumerated(EnumType.STRING)
public WebUserStatus getStatus() {
return status;
}
public void setStatus(WebUserStatus status) {
this.status = status;
}
will result in the following column:
status
- Type: varchar2(255)
- Length: 255
- Precision: 19
- Scale: 2
- Nullable: true
- Unique: false