TableColumns

annotation class TableColumns

The TableColumns annotation is useful to indicate the columns of a table and which order those columns have in that table. It is particularly useful for those method which have to handling queries, for example the com.tecknobit.equinoxbackend.environment.services.builtin.service.EquinoxItemsHelper.BatchQuery methods



          // The Simple object represents a table with the id, simple and week columns

          BatchQuery<Simple> batchQuery = new BatchQuery<>() {
            ...

            
            = {"id", "simple", "week"})
            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());
                }
            }

            
            = {"id", "simple", "week"})
            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 columns(): Array<String>
The list of the columns in the table
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