This seems to be the enumeration solution that I have been looking for and
have set up my enum to follow this model. I am new to the enum concept and
have a couple of questions that the tutorial didn't discuss.
First, where do I put the property tag reference for the enumClassName
parameter? I am assuming applicationContext-resources.xml, but have had
problems adding it there. The parser doesn't seem to like the mapping that
I have added, complains about keyword 'type':
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name='sex'>
<type name="GenericEnumUserType">
org.appfuse.tutorial.model.Person
</type>
</property>
Second, the getter and setter. I know this is typically straightforward,
but with the enum object, name, and value, I wanted to make sure I have it
set up properly. Since it is ultimately an int that is getting mapped to a
database column, here is how I built them:
private Sex sex;
public int getSex() {
return sex.toInt();
}
public void setSex(Sex sex) {
this.sex = sex;
}
Thanks.
--
View this message in context:
http://www.nabble.com/Java-5-Enums-Tutorial-Question-tp16321427s2369p16321427.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]