How to load enumeration in to guvnors use glassfish?
leipeter Dec 16, 2013 8:17 AMThe current version I am using:
Glassfish 3.1.2.2
Guvnors 5.4Final
Here is what I have:
1. I have load a POJO which contains a class/database table CollectionType with fields/members code, value, id
2. I create classes to simulate load enumerations for CollectionType.code: Please see below code.
3. I put the enum jar file in GLASSFISH_HOME\glassfish\modules
4. Create the new enumerations in Guvnor.
5. In the Enum edit screen, wrote the statement:
'CollectionType.Code' : CollectionTypeEnumLoad.loadSimpleCode
6. Receive error:
Question:
Where should I put the enumeration jar file? or any other thing I did wrong?
Thank you very in advance!
Best Regards,
Lei
================================== Code ================
public class CollectionTypeEnumLoad
{
private enum valueString {
THIRTY ("THIRTY DAYS"), SIXTY("SIXTY DAYS"), NINETY("NINETY DAYS"), THREE("ONE HUNDER TWENTY DAYS");
private String numberStr;
valueString(String number) {
this.numberStr = number;
}
public String getEnumString() {
return numberStr;
}
};
public static List <String> loadSimpleCode () {
List<String> returnList = new ArrayList<String>();
for (int i=0; i < 4; i++) {
String tempString = null;
switch {
case 0:
tempString = valueString.THIRTY.getEnumString();
break;
case 1:
tempString = valueString.SIXTY.getEnumString();
break;
case 2:
tempString =valueString.NINETY.getEnumString();
break;
case 3:
tempString = valueString.THREE.getEnumString();
}
returnList.add(tempString);
}
return returnList;
}
}