@Retention(value=RUNTIME) @Target(value=METHOD) public @interface ExtraField
ExtraField is used to identify a method in an entity configuration that extends the returned fields for an entity.
The field name is specified by the annotation's value. If a parameter is passed to the method it should be an object of the class supported by the configuration.
Example:
public class UserConfiguration extends YogaEntityConfiguration {
@Resource private MyService myService;
public Class getEntityClass() { return User.class; }
@ExtraField("recommendedAlbums")
public List getRecommendedAlbums(User user) {
myService.getRecommendedAlbums(user);
}
}
YogaEntityConfigurationpublic abstract String value
Copyright © 2014. All Rights Reserved.