Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Customer extends Record {
- private static final String TABLE = "customers";
- private static final List<ColumnInfo> COLUMNS;
- static {
- final List<ColumnInfo> columns = new ArrayList<ColumnInfo>();
- columns.add(new ColumnInfo("name", "text"));
- columns.add(new ColumnInfo("phone", "text"));
- columns.add(new ColumnInfo("phone", "text"));
- columns.add(new ColumnInfo("address", "text"));
- columns.add(new ColumnInfo("notes", "text"));
- COLUMNS = Collections.unmodifiableList(columns);
- }
- @Override
- public String getTable() {
- return TABLE;
- }
- @Override
- public List<ColumnInfo> getColumns() {
- return COLUMNS;
- }
- @Override
- public String toString() {
- return getValue("name");
- }
- }
- public class ColumnInfo {
- private final String name;
- private final String type;
- public ColumnInfo(final String name, final String type) {
- this.name = name;
- this.type = type;
- }
- public String getName() {
- return name;
- }
- public String getType() {
- return type;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement