public class DbEntity extends Object implements Serializable
| Constructor and Description |
|---|
DbEntity()
Creates a new instance of
DbEntity. |
| Modifier and Type | Method and Description |
|---|---|
DbEntity |
addColumn(Collection<DbColumn> dbColumn)
Adds the columns to the entity.
|
DbEntity |
addColumn(DbColumn dbColumn)
Adds a column to the entity.
|
DbEntity |
addColumn(String name,
DbColumnType type,
boolean autoInc,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity |
addColumn(String name,
DbColumnType type,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity |
addColumn(String name,
DbColumnType type,
Integer size,
boolean autoInc,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity |
addColumn(String name,
DbColumnType type,
Integer size,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity |
addColumn(String name,
DbColumnType type,
K defaultValue,
DbColumnConstraint... constraints)
Adds a column to the entity.
|
DbEntity |
addFk(DbFk... fks)
Adds the FKs.
|
DbEntity |
addFks(Collection<DbFk> fks)
Adds the FKs.
|
DbEntity |
addIndex(boolean unique,
String... columns)
Adds an index.
|
DbEntity |
addIndex(Collection<String> columns)
Adds an index.
|
DbEntity |
addIndex(DbIndex index)
Adds an index.
|
DbEntity |
addIndex(String... columns)
Adds an index.
|
boolean |
containsColumn(String columnName)
Checks if the entity has a column defined with the specified name.
|
List<DbColumn> |
getColumns() |
List<DbFk> |
getFks() |
List<DbIndex> |
getIndexes() |
String |
getName() |
String[] |
getPkFields() |
void |
removeColumn(String name)
Removes the column form the list of columns.
|
DbEntity |
setName(String name)
Sets the entity name.
|
DbEntity |
setPkFields(String... pkFields)
Sets the PK fields.
|
public DbEntity()
DbEntity.public DbEntity setName(String name)
name - The name.public DbEntity addColumn(DbColumn dbColumn)
dbColumn - The column.public DbEntity addColumn(Collection<DbColumn> dbColumn)
dbColumn - The columns.public DbEntity addColumn(String name, DbColumnType type, DbColumnConstraint... constraints)
name - The entity name.type - The entity type.constraints - The list of constraints.public DbEntity addColumn(String name, DbColumnType type, Integer size, DbColumnConstraint... constraints)
name - The entity name.type - The entity type.size - The type size.constraints - The list of constraints.public DbEntity addColumn(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 addColumn(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 addColumn(String name, DbColumnType type, 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 void removeColumn(String name)
name - The column name.public DbEntity setPkFields(String... pkFields)
pkFields - The PK fields.public DbEntity addIndex(DbIndex index)
index - The index.public DbEntity addIndex(boolean unique, String... columns)
unique - True if the index is unique, false otherwise.columns - The columns that are part of the index.public DbEntity addIndex(String... columns)
columns - The columns that are part of the index.public DbEntity addIndex(Collection<String> columns)
columns - The columns that are part of the index.public DbEntity addFk(DbFk... fks)
fks - The list of FKs.public DbEntity addFks(Collection<DbFk> fks)
fks - The list of FKs.public boolean containsColumn(String columnName)
columnName - The column name.public String getName()
public String[] getPkFields()
Copyright © 2013. All Rights Reserved.