Hello,
Thus far I've been unsuccessful in finding a resolution to my problem. I'm hoping that somebody here will be able to help.
I use ant's xjc task to create objects from a database schema. The code tables become Java Enum objects such as:
I have a POJO, MyObject, with the following parameters:Code:public enum MyEnum { VAL1, VAL2; public String value() { return name(); } public static MyEnum fromValue(String v) { return valueOf(v); } }
I do a simple query and in the DAO SQL I create a result map as follows:Code:private String ID; private MyEnum enum;
My question is - how do I map the value I retrieve from db (called enum) to the MyEnum class?Code:<resultMap id="pojoMap" class="MyObject"> <result property="ID" column="ID" /> <result property="enum" resultMap="MyObject.enumMap" /> </resultMap> <resultMap id="enumMap" class="MyEnum"> <result property="?????" value="enum" /> </resultMap>![]()
No matter what I replace the ????? with it doesn't work and it fails with the following error:
Any help is appreciated!Code:Cause: com.ibatis.common.beans.ProbeException: There is no WRITEABLE property named '?????'; in class 'MyEnum'


Reply With Quote


