A Single Row Example
Select one row by primary key, 1234. Reduce row quantity by 1.
// set up
Database database = new Database(getConnection());
Table<Inventory> inventoryTable = database.getTable(Inventory.class);
// get part by primary key
Inventory inventory = inventoryTable.select("1234");
// update
inventory.setQuantity(inventory.getQuantity() - 1);
inventoryTable.update(inventory);
INVENTORY schema and Inventory.java used by this example.
See SimpleExample.java class in the Simple Example download.
|