Table.
Example:
Table table = new TableBuilder("Test")
.addColumn(new ColumnBuilder("ID", DataType.LONG)
.setAutoNumber(true))
.addColumn(new ColumnBuilder("Name", DataType.TEXT))
.addIndex(new IndexBuilder(IndexBuilder.PRIMARY_KEY_NAME)
.addColumns("ID").setPrimaryKey())
.toTable(db);
ColumnBuilder, IndexBuilder, RelationshipBuilder
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final List | columns
columns for the new table |
| private static final String | ESCAPE_PREFIX
Prefix for column or table names that are reserved words |
| private boolean | escapeIdentifiers
whether or not table/column/index names are automatically escaped |
| private final List | indexes
indexes for the new table |
| private String | name
name of the new table |
| private Map | props
table properties (if any) |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public TableBuilder | |
| public TableBuilder | |
| public TableBuilder | |
| public TableBuilder | |
| public static String | Returns: A table or column name escaped for AccessReturns a table or column name escaped for Access. |
| public TableBuilder | |
| public List | |
| public List | |
| public String | |
| public Map | |
| public static boolean | Returns: true if the given string is a reserved word, false otherwiseReturns |
| public TableBuilder | putProperty(String propName, Object value)
Sets the table property with the given name to the given value. |
| public TableBuilder | putProperty(String propName, DataType propType, Object value)
Sets the table property with the given name and type to the given value. |
| public String | |
| public Table | |
| public TableBuilder | withEscapeIdentifiers(boolean newEscapeIdentifiers)
Sets whether or not subsequently added columns will have their names automatically escaped |
| public TableBuilder |
| columns | back to summary |
|---|---|
| private final List<ColumnBuilder> columns columns for the new table | |
| ESCAPE_PREFIX | back to summary |
|---|---|
| private static final String ESCAPE_PREFIX Prefix for column or table names that are reserved words | |
| escapeIdentifiers | back to summary |
|---|---|
| private boolean escapeIdentifiers whether or not table/column/index names are automatically escaped | |
| indexes | back to summary |
|---|---|
| private final List<IndexBuilder> indexes indexes for the new table | |
| name | back to summary |
|---|---|
| private String name name of the new table | |
| props | back to summary |
|---|---|
| private Map<String, PropertyMap. table properties (if any) | |
| TableBuilder | back to summary |
|---|---|
| public TableBuilder(String name) | |
| TableBuilder | back to summary |
|---|---|
| public TableBuilder(String name, boolean escapeIdentifiers) | |
| addColumn | back to summary |
|---|---|
| public TableBuilder addColumn(ColumnBuilder column) Adds a Column to the new table. | |
| addColumns | back to summary |
|---|---|
| public TableBuilder addColumns(Collection<? extends ColumnBuilder> newColumns) Adds the Columns to the new table. | |
| addIndex | back to summary |
|---|---|
| public TableBuilder addIndex(IndexBuilder index) Adds an IndexBuilder to the new table. | |
| addIndexes | back to summary |
|---|---|
| public TableBuilder addIndexes(Collection<? extends IndexBuilder> newIndexes) Adds the Indexes to the new table. | |
| escapeIdentifier | back to summary |
|---|---|
| public static String escapeIdentifier(String s) Returns a table or column name escaped for Access.
| |
| escapeName | back to summary |
|---|---|
| public TableBuilder escapeName() Escapes the new table's name using | |
| getColumns | back to summary |
|---|---|
| public List | |
| getIndexes | back to summary |
|---|---|
| public List | |
| getName | back to summary |
|---|---|
| public String getName() | |
| getProperties | back to summary |
|---|---|
| public Map | |
| isReservedWord | back to summary |
|---|---|
| public static boolean isReservedWord(String s) Returns
| |
| putProperty | back to summary |
|---|---|
| public TableBuilder putProperty(String propName, Object value) Sets the table property with the given name to the given value. Attempts to determine the type of the property
(see | |
| putProperty | back to summary |
|---|---|
| public TableBuilder putProperty(String propName, DataType propType, Object value) Sets the table property with the given name and type to the given value. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| toTable | back to summary |
|---|---|
| public Table toTable(Database db) throws IOException Creates a new Table in the given Database with the currently configured attributes. | |
| withEscapeIdentifiers | back to summary |
|---|---|
| public TableBuilder withEscapeIdentifiers(boolean newEscapeIdentifiers) Sets whether or not subsequently added columns will have their names automatically escaped | |
| withPrimaryKey | back to summary |
|---|---|
| public TableBuilder withPrimaryKey(String... colNames) Sets the names of the primary key columns for this table. Convenience method for creating a primary key index on a table. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final Set | VALUES
All of the reserved words in Access that should be escaped when creating table or column names |
| Access | Constructor and Description |
|---|---|
| private |
| VALUES | back to summary |
|---|---|
| private static final Set<String> VALUES All of the reserved words in Access that should be escaped when creating table or column names | |
| ReservedWords | back to summary |
|---|---|
| private ReservedWords() | |