.getIdentifierType(entity);
if (identifierType == null) {
return null;
}
final MemberDetails memberDetails = getMemberDetails(entity);
if (memberDetails == null) {
return null;
}
final MemberHoldingTypeDetails persistenceMemberHoldingTypeDetails = MemberFindingUtils
.getMostConcreteMemberHoldingTypeDetailsWithTag(memberDetails,
PERSISTENT_TYPE);
if (persistenceMemberHoldingTypeDetails == null) {
return null;
}
// We need to be informed if our dependent metadata changes
metadataDependencyRegistry.registerDependency(
persistenceMemberHoldingTypeDetails.getDeclaredByMetadataId(),
metadataIdentificationString);
final MethodParameter firstResultParameter = new MethodParameter(
INT_PRIMITIVE, "firstResult");
final MethodParameter maxResultsParameter = new MethodParameter(
INT_PRIMITIVE, "maxResults");
final MethodMetadata identifierAccessorMethod = memberDetails
.getMostConcreteMethodWithTag(IDENTIFIER_ACCESSOR_METHOD);
final MethodMetadata versionAccessorMethod = persistenceMemberLocator
.getVersionAccessor(entity);
final MemberTypeAdditions countMethodAdditions = layerService
.getMemberTypeAdditions(metadataIdentificationString,
COUNT_ALL_METHOD.name(), entity, identifierType,
LAYER_POSITION);
final MemberTypeAdditions findMethodAdditions = layerService
.getMemberTypeAdditions(metadataIdentificationString,
FIND_METHOD.name(), entity, identifierType,
LAYER_POSITION, new MethodParameter(identifierType,
"id"));
final MemberTypeAdditions findAllMethodAdditions = layerService
.getMemberTypeAdditions(metadataIdentificationString,
FIND_ALL_METHOD.name(), entity, identifierType,
LAYER_POSITION);
final MemberTypeAdditions findEntriesMethod = layerService
.getMemberTypeAdditions(metadataIdentificationString,
FIND_ENTRIES_METHOD.name(), entity, identifierType,
LAYER_POSITION, firstResultParameter,
maxResultsParameter);
final MethodParameter entityParameter = new MethodParameter(entity,
"obj");
final MemberTypeAdditions flushMethodAdditions = layerService
.getMemberTypeAdditions(metadataIdentificationString,
FLUSH_METHOD.name(), entity, identifierType,
LAYER_POSITION, entityParameter);
final MemberTypeAdditions mergeMethodAdditions = layerService
.getMemberTypeAdditions(metadataIdentificationString,
MERGE_METHOD.name(), entity, identifierType,
LAYER_POSITION, entityParameter);
final MemberTypeAdditions persistMethodAdditions = layerService
.getMemberTypeAdditions(metadataIdentificationString,
PERSIST_METHOD.name(), entity, identifierType,
LAYER_POSITION, entityParameter);
final MemberTypeAdditions removeMethodAdditions = layerService
.getMemberTypeAdditions(metadataIdentificationString,
REMOVE_METHOD.name(), entity, identifierType,
LAYER_POSITION, entityParameter);
if (persistMethodAdditions == null || findMethodAdditions == null
|| identifierAccessorMethod == null) {
return null;
}
String transactionManager = null;
final AnnotationMetadata jpaActiveRecordAnnotation = memberDetails
.getAnnotation(ROO_JPA_ACTIVE_RECORD);
if (jpaActiveRecordAnnotation != null) {
final StringAttributeValue transactionManagerAttr = (StringAttributeValue) jpaActiveRecordAnnotation
.getAttribute(TRANSACTION_MANAGER_ATTRIBUTE);
if (transactionManagerAttr != null) {