XMLDirectMapping modificationDeferralLevelMapping = new XMLDirectMapping();
modificationDeferralLevelMapping.setAttributeName("modificationDeferralLevel");
modificationDeferralLevelMapping.setGetMethodName("getDeferModificationsUntilCommit");
modificationDeferralLevelMapping.setSetMethodName("setDeferModificationsUntilCommit");
ObjectTypeConverter modificationDeferralLevelConverter = new ObjectTypeConverter();
modificationDeferralLevelConverter.addConversionValue("all-modifications", new Integer(CMPPolicy.ALL_MODIFICATIONS));
modificationDeferralLevelConverter.addConversionValue("update-modifications", new Integer(CMPPolicy.UPDATE_MODIFICATIONS));
modificationDeferralLevelConverter.addConversionValue("none", new Integer(CMPPolicy.NONE));
modificationDeferralLevelMapping.setConverter(modificationDeferralLevelConverter);
modificationDeferralLevelMapping.setXPath(getPrimaryNamespaceXPath() + "defer-until-commit/text()");
modificationDeferralLevelMapping.setNullValue(new Integer(CMPPolicy.ALL_MODIFICATIONS));
descriptor.addMapping(modificationDeferralLevelMapping);
XMLDirectMapping nonDeferredCreateTimeMapping = new XMLDirectMapping();
nonDeferredCreateTimeMapping.setAttributeName("nonDeferredCreateTime");
nonDeferredCreateTimeMapping.setGetMethodName("getNonDeferredCreateTime");
nonDeferredCreateTimeMapping.setSetMethodName("setNonDeferredCreateTime");
ObjectTypeConverter nonDeferredCreateTimeConverter = new ObjectTypeConverter();
nonDeferredCreateTimeConverter.addConversionValue("after-ejbcreate", new Integer(CMPPolicy.AFTER_EJBCREATE));
nonDeferredCreateTimeConverter.addConversionValue("after-ejbpostcreate", new Integer(CMPPolicy.AFTER_EJBPOSTCREATE));
nonDeferredCreateTimeConverter.addConversionValue("undefined", new Integer(CMPPolicy.UNDEFINED));
nonDeferredCreateTimeMapping.setConverter(nonDeferredCreateTimeConverter);
nonDeferredCreateTimeMapping.setXPath(getPrimaryNamespaceXPath() + "non-deferred-create-time/text()");
nonDeferredCreateTimeMapping.setNullValue(new Integer(CMPPolicy.UNDEFINED));
descriptor.addMapping(nonDeferredCreateTimeMapping);