}
// We know there should be an existing RooEntity annotation
final List<? extends AnnotationMetadata> annotations = cid
.getAnnotations();
final AnnotationMetadata jpaActiveRecordAnnotation = MemberFindingUtils
.getAnnotationOfType(annotations, ROO_JPA_ACTIVE_RECORD);
if (jpaActiveRecordAnnotation == null) {
LOGGER.warning("Unable to find the entity annotation on '"
+ typeName.getFullyQualifiedTypeName() + "'");
return;
}
// Confirm they typed a valid finder name
final MemberDetails memberDetails = memberDetailsScanner
.getMemberDetails(getClass().getName(), cid);
if (dynamicFinderServices.getQueryHolder(memberDetails, finderName,
jpaActiveRecordMetadata.getPlural(),
jpaActiveRecordMetadata.getEntityName()) == null) {
LOGGER.warning("Finder name '" + finderName.getSymbolName()
+ "' either does not exist or contains an error");
return;
}
// Make a destination list to store our final attributes
final List<AnnotationAttributeValue<?>> attributes = new ArrayList<AnnotationAttributeValue<?>>();
final List<StringAttributeValue> desiredFinders = new ArrayList<StringAttributeValue>();
// Copy the existing attributes, excluding the "finder" attribute
boolean alreadyAdded = false;
final AnnotationAttributeValue<?> val = jpaActiveRecordAnnotation
.getAttribute(new JavaSymbolName("finders"));
if (val != null) {
// Ensure we have an array of strings
if (!(val instanceof ArrayAttributeValue<?>)) {
LOGGER.warning(getErrorMsg());