| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<DbColumn> |
columns |
protected java.util.List<DbFk> |
fks |
protected java.util.List<DbIndex> |
indexes |
protected java.lang.String |
name |
protected java.util.List<java.lang.String> |
pkFields |
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
DbEntity.Builder |
addColumn(java.util.Collection<DbColumn> dbColumn)
Adds the columns to the entity.
|
DbEntity.Builder |
addColumn(DbColumn dbColumn)
Adds a column to the entity.
|
DbEntity.Builder |
addColumn(java.lang.String name,
DbColumnType type,
boolean autoInc,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity.Builder |
addColumn(java.lang.String name,
DbColumnType type,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity.Builder |
addColumn(java.lang.String name,
DbColumnType type,
java.lang.Integer size,
boolean autoInc,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity.Builder |
addColumn(java.lang.String name,
DbColumnType type,
java.lang.Integer size,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity.Builder |
addColumn(java.lang.String name,
DbColumnType type,
K defaultValue,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity.Builder |
addFk(java.util.Collection<DbFk> fks)
Adds the FKs.
|
DbEntity.Builder |
addFk(DbFk... fks)
Adds the FKs.
|
DbEntity.Builder |
addFk(DbFk.Builder... fks)
Adds the FKs.
|
DbEntity.Builder |
addFks(java.util.Collection<DbFk> fks)
Adds the FKs.
|
DbEntity.Builder |
addIndex(boolean unique,
java.lang.String... columns)
Adds an index.
|
DbEntity.Builder |
addIndex(java.util.Collection<java.lang.String> columns)
Adds an index.
|
DbEntity.Builder |
addIndex(DbIndex index)
Adds an index.
|
DbEntity.Builder |
addIndex(java.lang.String... columns)
Adds an index.
|
DbEntity.Builder |
addIndexes(java.util.Collection<DbIndex> indexes)
Adds an index.
|
DbEntity |
build()
Builds the final immutable instance.
|
DbEntity.Builder |
clearFks()
Clears all the FKs in this builder.
|
DbEntity.Builder |
name(java.lang.String name)
Sets the entity name.
|
DbEntity.Builder |
pkFields(java.util.Collection<java.lang.String> pkFields)
Sets the PK fields.
|
DbEntity.Builder |
pkFields(java.lang.String... pkFields)
Sets the PK fields.
|
DbEntity.Builder |
removeColumn(java.lang.String name)
Removes the column with the given name.
|
protected java.lang.String name
protected final java.util.List<DbColumn> columns
protected final java.util.List<DbFk> fks
protected final java.util.List<java.lang.String> pkFields
protected final java.util.List<DbIndex> indexes
public DbEntity.Builder name(java.lang.String name)
name - The entity name.public DbEntity.Builder addColumn(DbColumn dbColumn)
dbColumn - The column to add.public DbEntity.Builder removeColumn(java.lang.String name)
name - The column name to remove.public DbEntity.Builder addColumn(java.util.Collection<DbColumn> dbColumn)
dbColumn - The columns to add.public DbEntity.Builder addColumn(java.lang.String name, DbColumnType type, DbColumnConstraint... constraints)
name - The entity name.type - The entity type.constraints - The list of constraints.public DbEntity.Builder addColumn(java.lang.String name, DbColumnType type, java.lang.Integer size, DbColumnConstraint... constraints)
name - The entity name.type - The entity type.size - The type size.constraints - The list of constraints.public DbEntity.Builder addColumn(java.lang.String name, DbColumnType type, boolean autoInc, DbColumnConstraint... constraints)
name - The entity name.type - The entity type.autoInc - true if the column is to autoincrement, false otherwise.constraints - The list of constraints.public DbEntity.Builder addColumn(java.lang.String name, DbColumnType type, K defaultValue, DbColumnConstraint... constraints)
name - The entity name.type - The entity type.defaultValue - The defaultValue for the column.constraints - The list of constraints.public DbEntity.Builder addColumn(java.lang.String name, DbColumnType type, java.lang.Integer size, boolean autoInc, DbColumnConstraint... constraints)
name - The entity name.type - The entity type.size - The type size.autoInc - True if the column is to autoincrement, false otherwise.constraints - The list of constraints.public DbEntity.Builder pkFields(java.lang.String... pkFields)
pkFields - The PK fields.public DbEntity.Builder pkFields(java.util.Collection<java.lang.String> pkFields)
pkFields - The PK fields.public DbEntity.Builder addIndex(DbIndex index)
index - The index.public DbEntity.Builder addIndexes(java.util.Collection<DbIndex> indexes)
indexes - The index.public DbEntity.Builder addIndex(boolean unique, java.lang.String... columns)
unique - true if the index is unique, false otherwise.columns - The columns that are part of the index.public DbEntity.Builder addIndex(java.lang.String... columns)
columns - The columns that are part of the index.public DbEntity.Builder addIndex(java.util.Collection<java.lang.String> columns)
columns - The columns that are part of the index.public DbEntity.Builder addFk(DbFk... fks)
fks - The list of FKs.public DbEntity.Builder addFk(DbFk.Builder... fks)
fks - The list FKs builders..public DbEntity.Builder addFk(java.util.Collection<DbFk> fks)
fks - The list of FKs.public DbEntity.Builder clearFks()
public DbEntity.Builder addFks(java.util.Collection<DbFk> fks)
fks - The list of FKs.Copyright © 2020 Feedzai. All Rights Reserved.