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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to