try {
String fieldName = id.getName();
String methodName = convertFieldNameToGetterName(fieldName);
String[] emptySignature = new String[0];
facade.addMethodAnnotation(entityBean.getEjbClass(), methodName, emptySignature, javax.persistence.Id.class, null);
GeneratedValue generatedValue = id.getGeneratedValue();
if (generatedValue != null) {
Map<String, Object> generatedValueProps = new HashMap<String, Object>();
if (generatedValue.getGenerator() != null) {
generatedValueProps.put("generator", generatedValue.getGenerator()); //$NON-NLS-1$
}
GenerationType strategy = generatedValue.getStrategy();
switch (strategy) {
case AUTO:
generatedValueProps.put("strategy", javax.persistence.GenerationType.AUTO); //$NON-NLS-1$
break;
case IDENTITY: