Creating a Table

Examples of creating a table

In this class you can create your own custom getters and setters.

Design Tables

/**
 * <h1>Represents the customer table</h1>
 */
public class CustomerTable extends TableAdapter<Customer> {

    @Override
    public @NotNull String getName() {
        return "Customer";
    }
}
/**
 * <h1>Represents a purchase table</h1>
 */
public class PurchaseTable extends TableAdapter<Purchase> {

    @Override
    public @NotNull String getName() {
        return "Purchase";
    }
}

Add to the Database

CustomerTable customerTable = new CustomerTable();
database.createTable(customerTable);

PurchaseTable purchaseTable = new PurchaseTable();
database.createTable(purchaseTable);

Last updated