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) {