BatchQueryImpl

annotation class 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"};
    }

}

Author

N7ghtm4r3 - Tecknobit

Since

1.0.8

Functions

Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
Link copied to clipboard
abstract fun description(): String
Informative description about the behavior of the implemented batch query
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun toString(): String