BatchQueryImpl
The BatchQueryImpl
annotation is useful to indicate an implementation of a com.tecknobit.equinoxbackend.environment.services.builtin.service.EquinoxItemsHelper.BatchQuery
// The Simple object represents a table with the id, simple, and week columns
// not mandatory
description= """
Informative description about the behavior of the implemented batch query"
""" // suggested text block
)
public class SimpleBatchQuery implements EquinoxItemsHelper.BatchQuery<Simple> {
private List<Simple> data;
public SimpleBatchQuery(List<Simple> data) {
this.data = data;
}
public Collection<Simple> getData() {
return data;
}
public void prepareQuery(Query query, int index, Collection<Simple> items) {
for (Simple item : items) {
query.setParameter(index++, item.getId());
query.setParameter(index++, item.getSimple());
query.setParameter(index++, item.getWeek());
}
}
public String[] getColumns() {
return new String[]{"id", "simple", "week"};
}
}
Content copied to clipboard
Author
N7ghtm4r3 - Tecknobit
Since
1.0.8