// Get the additions to make for each required method
final MethodParameter fromParameter = new MethodParameter(
JavaType.INT_PRIMITIVE, "from");
final MethodParameter toParameter = new MethodParameter(
JavaType.INT_PRIMITIVE, "to");
final MemberTypeAdditions findEntriesMethod = layerService
.getMemberTypeAdditions(dodMetadataId,
FIND_ENTRIES_METHOD.name(), entity, identifierType,
LayerType.HIGHEST.getPosition(), fromParameter,
toParameter);
final MemberTypeAdditions findMethodAdditions = layerService
.getMemberTypeAdditions(dodMetadataId, FIND_METHOD.name(),
entity, identifierType,
LayerType.HIGHEST.getPosition(), new MethodParameter(
identifierType, "id"));
final MethodParameter entityParameter = new MethodParameter(entity,
"obj");
final MemberTypeAdditions flushMethod = layerService
.getMemberTypeAdditions(dodMetadataId, FLUSH_METHOD, entity,
identifierType, LayerType.HIGHEST.getPosition(),
entityParameter);
final MethodMetadata identifierAccessor = memberDetails
.getMostConcreteMethodWithTag(IDENTIFIER_ACCESSOR_METHOD);
final MemberTypeAdditions persistMethodAdditions = layerService
.getMemberTypeAdditions(dodMetadataId, PERSIST_METHOD, entity,
identifierType, LayerType.HIGHEST.getPosition(),
entityParameter);
if (findEntriesMethod == null || findMethodAdditions == null