public static List<ImageAttribute> attributesForImageAndMode( Project project, DatabaseImage image, Boolean dataMode) { if (dataMode == null) { List<ImageAttribute> attributes = ImageAttribute.find("byProjectAndImage", project, image).fetch(); return attributes; } else { List<ImageAttribute> attributes = ImageAttribute.find("byProjectAndImageAndData", project, image, dataMode).fetch(); return attributes; } }