EJB3 quicky

i'm writing my first EJB3 application, and i have a question (2 actually :P).

I have an entity class that has a number of properties, which i would like to persist, such as:

@Column (unique=false, nullable=false, length=50)

private String name;

1) one of my properties is an enum. I want to persist this as a String representation of the enum, not as an ordinal number. how can i do this?!

I tried doing:

@Enumerated(STRING)

private MyEnumType myEnum;

but I am getting the error "variable STRING not found"!

2) when you mark a column as "nullable=false", and when you persist the entity, the value of the string column happens to be null, howcome it is still persisted? shouldn't some kind of exception come up when you persist a null value in a non-nullable column!?

thanks !

Message was edited by:

Guy007

[954 byte] By [Guy007a] at [2007-11-26 13:44:13]
# 1
as for you @Enumerated question, you say:@Enumerated(EnumType.STRING)I think the documentation is incorrect on that one.
tieTYTa at 2007-7-8 1:18:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...