Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

@Retention(CLASS) @Target({METHOD})

public @interface BatchMapping

Resolves a field for every object in a list with one call, as in Spring for GraphQL: the answer to the N+1 problem of a SchemaMapping that would otherwise query once per object.

The method takes a List of the sources and returns either a Map from each source to its value, or a List with one value per source in order.

@BatchMapping(typeName = "Book")
public Map<Book, Author> author(List<Book> books) { ... }

Methods

public abstract String typeName() default ""The object type the field belongs to; empty means the class’s @SchemaMapping type.
public abstract String value() default ""The field’s name; empty means the method’s name.
public abstract String field() default ""The field’s name; empty means the method’s name.

Method details

typeName

public abstract String typeName() default ""
The object type the field belongs to; empty means the class’s @SchemaMapping type.

value

public abstract String value() default ""
The field’s name; empty means the method’s name. Same as field().

field

public abstract String field() default ""
The field’s name; empty means the method’s name. Same as value().