SQL delete operation for row of type R.
SQL insert operation for row of type R.
Base class for operations that modify database.
SQL update or insert operation for row of type R.
Select operation that reads one value at a time.
Iterator for a
SQL select operation returning a collection of rows.
Base class for all database operations.
SQL update operation for row of type R.
Used for one of several error conditions that can occur when
Indicates a field name was not found in a class.
Exception that originates in the operation package.
Indicates an insert, update, or delete was attempted for a table that is read only.
There are two types of operations: select operations and modify operations.
All select operations are derived from
SelectOperation. Insert, save, update, and, delete
operations are derived from
Use operation classes instead of
Table methods if you
need to perform the same operation many times but only want to prepare it once
For example, select all students by type 3 and then by type 4 with the same operation. "byType" is name of Where annotation on Student:
To update rows (insert, save, and delete are similar):Database database = ... Table<Student> table = database.getTable(Student.class); ArrayListSelectOperation<Student> op = new ArrayListSelectOperation<>(table, "byType"); op.setParameters(3); op.execute(); // JDBC prepare occurs here List<Student> selectedList3 = op.readAll(); op.setParameters(4); op.execute(); // no prepare needed List<Student> selectedList4 = op.readAll(); op.close();
Database database = ... Table<Student> table = database.getTable(Student.class); UpdateOperation<Student> op = new UpdateOperation<>(table); List<Student> list1 = ...; op.setRows(list1); op.execute(); // JDBC prepare occurs here List<Student> list2 = ...; op.setRows(list2); op.execute(); // no prepare needed op.close();