|
To Use Sormula:
- Install it:
- Download jar
- Extract sormula zip
- Add libraries to classpath:
- sormula jar
- JDBC jar for your database
- Use any logger that you like or none at all
- Use it:
- Create a Java class, SomeRow, that corresponds to a table in the database
- Annotate SomeRow class as needed to define table and column information that differ from Sormula defaults
- Add cascade annotations (optional) to define one-to-many and one-to-one relationships
- Open JDBC connection to database
- Database database = new Database(connection);
- Table<SomeRow> table = database.getTable(SomeRow.class); or
Table<SomeRow> table = new Table(database, SomeRow.class);
- SomeRow row = table.select(somekey);
- table.update(row);
- table.insert(row);
- table.delete(row);
|
|