sormula | simple (easy) object relational mapping | |
|
A Collection of Rows Example
Set quantity to zero for ACME manufacturer.
// set up Database database = new Database(getConnection()); Table<Inventory> inventoryTable = database.getTable(Inventory.class); // for all inventory of manufacturer // "manf" is name of where annotation in Inventory.java List<Inventory> list = inventoryTable.selectAllWhere("manf", "ACME"); for (Inventory inventory: list) { inventory.setQuantity(0); } // update inventoryTable.updateAll(list); |
|
© 2018 Sormula, LLC |