Re: Custom attribute class conversion in entity modeler
Re: Custom attribute class conversion in entity modeler
- Subject: Re: Custom attribute class conversion in entity modeler
- From: "Ricardo J. Parada" <email@hidden>
- Date: Mon, 09 Feb 2009 12:02:57 -0500
On Feb 8, 2009, at 6:50 AM, Riccardo De Menna wrote: public static enum Status { ACTIVE(0), DISABLED(1), TRIAL(2), DELETED(-2); private static final Map<Integer,Status> lookup = new HashMap<Integer,Status>(); public static Status forID(int id) { return lookup.get(id); } private final int _id; private Status(int id) { _id = id; } public int id() { return _id; } static { for( Status s : EnumSet.allOf(Status.class) ) lookup.put(s.id(), s); } }
Hi Riccardo,
Could you share what your EOAttribute looks like in the eomodeld for this status attribute. For example, I have one that is stored as a string in the database and mine looks as follows:
{ allowsNull = N; columnName = "STATUS"; externalType = VARCHAR2; width = 20; name = status; valueClassName = "com.mpv.contractanalysis.ContractAnalysisStatus"; adaptorValueConversionMethodName = name; factoryMethodArgumentType = EOFactoryMethodArgumentIsNSString; valueFactoryMethodName = valueOf; },
I would imagine that for your attribute, the adaptorValueConversionMethodName is id. I'm interested in what your factoryMethodArgumentType and valueFactoryMethodName are set with.
Thanks, Ricardo J. Parada
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden