deleteMethodCall = fieldName + "."
+ deleteMethodAdditions.getMethodName() + "()";
}
final List<AnnotationAttributeValue<?>> attributes = new ArrayList<AnnotationAttributeValue<?>>();
attributes.add(new StringAttributeValue(new JavaSymbolName("value"),
idFieldName.getSymbolName()));
final AnnotationMetadataBuilder pathVariableAnnotation = new AnnotationMetadataBuilder(
PATH_VARIABLE, attributes);
final List<AnnotationAttributeValue<?>> firstResultAttributes = new ArrayList<AnnotationAttributeValue<?>>();
firstResultAttributes.add(new StringAttributeValue(new JavaSymbolName(
"value"), "page"));
firstResultAttributes.add(new BooleanAttributeValue(new JavaSymbolName(
"required"), false));
final AnnotationMetadataBuilder firstResultAnnotation = new AnnotationMetadataBuilder(
REQUEST_PARAM, firstResultAttributes);
final List<AnnotationAttributeValue<?>> maxResultsAttributes = new ArrayList<AnnotationAttributeValue<?>>();
maxResultsAttributes.add(new StringAttributeValue(new JavaSymbolName(
"value"), "size"));
maxResultsAttributes.add(new BooleanAttributeValue(new JavaSymbolName(
"required"), false));
final AnnotationMetadataBuilder maxResultAnnotation = new AnnotationMetadataBuilder(
REQUEST_PARAM, maxResultsAttributes);
final List<AnnotatedJavaType> parameterTypes = Arrays.asList(
new AnnotatedJavaType(javaTypePersistenceMetadataHolder
.getIdentifierType(), pathVariableAnnotation.build()),
new AnnotatedJavaType(new JavaType(Integer.class.getName()),
firstResultAnnotation.build()), new AnnotatedJavaType(
new JavaType(Integer.class.getName()),
maxResultAnnotation.build()), new AnnotatedJavaType(
MODEL));
final List<JavaSymbolName> parameterNames = Arrays.asList(idFieldName,
new JavaSymbolName("page"), new JavaSymbolName("size"),
new JavaSymbolName("uiModel"));
final List<AnnotationAttributeValue<?>> requestMappingAttributes = new ArrayList<AnnotationAttributeValue<?>>();
requestMappingAttributes.add(new StringAttributeValue(
new JavaSymbolName("value"), "/{" + idFieldName.getSymbolName()
+ "}"));
requestMappingAttributes.add(new EnumAttributeValue(new JavaSymbolName(
"method"), new EnumDetails(REQUEST_METHOD, new JavaSymbolName(
"DELETE"))));