Table specified ORM interface
https://gyazo.com/24ff19bd6684cdb91dbfdd13cf37022a #Table_specified_ORM_interface
code:java
// Creates an entry point
Sorm sorm = Sorm.create("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;");
// Create a table access object.
Table<Customer> customerTable = Table.of(sorm, Customer.class);
// Open TableConnection. It will be closed with try-with-resources block.
try (TableConnection<Customer> conn = customerTable.open()) {
// Print table definition.
System.out.println(conn.getTableMetaData());
// Insert objects.
conn.insert(Customer.ALICE, Customer.BOB, Customer.CAROL, Customer.DAVE);
// Print all rows on the customer table.
System.out.println(conn.selectAll());
} catch (Exception e) {
e.printStackTrace();
}
org.nkjmlab.sorm4j.table.definition
Table definition helper