sormula simple (easy) object relational mapping
DAO Example
Sormula does not require DAO's but they are easy to implement.
// set up
Database database = new Database(connection);
InventoryDAO inventoryDAO = new InventoryDAO(database);

// get part by primary key
Inventory inventory = inventoryDAO.select("1234");

// update
inventory.setQuantity(inventory.getQuantity() - 1);
   inventoryDAO.update(inventory);
InventoryDAO.java
DAO's are trivial to implement with Sormula.
public class InventoryDAO extends Table<Inventory>
{
    public InventoryDAO(Database database) throws SormulaException
    {
        super(database, Inventory.class);
    }
}
The InventoryDAO implemented this way will inherit all of the methods from Table including these common methods:
public int delete(Inventory row)
public int delete(Object... parameters)
public int deleteAll()
public int deleteAll(Collection<Inventory> rows)
public int deleteAllBatch(Collection<Inventory> rows)
public int insert(Inventory row)
public int insertAll(Collection<Inventory> rows)
public int insertAllBatch(Collection<Inventory> rows)
public int save(Inventory row)
public int saveAll(Collection<Inventory> rows)
public Inventory select(Object... primaryKeys)
public List<Inventory> selectAll()
public List<Inventory> selectAllCustom(String customSql, Object... parameters)
public List<Inventory> selectAllWhere(String whereConditionName, Object... parameters)
public List<Inventory> selectAllWhereOrdered(String whereConditionName, String orderByName, Object... parameters)
public Inventory selectAvg(String expression)
public Inventory selectCount(String expression, String whereConditionName, Object... parameters)
public Inventory selectCount(String expression)
public Inventory selectCustom(String customSql, Object... parameters)
public Inventory selectMax(String expression, String whereConditionName, Object... parameters)
public Inventory selectMax(String expression)
public Inventory selectMin(String expression, String whereConditionName, Object... parameters)
public Inventory selectMin(String expression)
public Inventory selectSum(String expression, String whereConditionName, Object... parameters)
public Inventory selectSum(String expression)
public Inventory selectWhere(String whereConditionName, Object... parameters)
public int update(Inventory row)
public int updateAll(Collection<Inventory> rows)
public int updateAllBatch(Collection<Inventory> rows)
INVENTORY schema and Inventory.java used by this example. See SimpleExample.java class in the Simple Example download.