public class AmberTable
extends java.lang.Object
Constructor and Description |
---|
AmberTable(AmberPersistenceUnit manager,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
AmberColumn |
addColumn(AmberColumn column)
Adds a column.
|
void |
addEntityListener(EntityListener listener)
Adds a listener for create/delete events
|
void |
addIdColumn(AmberColumn column)
Adds an id column.
|
void |
beforeEntityDelete(AmberConnection aConn,
Entity entity)
Called before the entity is deleted.
|
AmberColumn |
createColumn(java.lang.String name,
AmberType type)
Creates a column.
|
void |
createDatabaseTable(AmberPersistenceUnit amberPersistenceUnit)
Creates the table if missing.
|
ForeignColumn |
createForeignColumn(java.lang.String name,
AmberColumn key)
Creates a foreign column.
|
protected ConfigException |
error(java.lang.String msg,
java.lang.Throwable e) |
protected java.lang.RuntimeException |
error(java.lang.Throwable e) |
AmberPersistenceUnit |
getAmberManager()
Returns the amber manager.
|
long |
getCacheTimeout()
Returns the cache timeout.
|
java.util.ArrayList<AmberColumn> |
getColumns()
Returns the columns.
|
AmberCompletion |
getDeleteCompletion()
Returns the table's invalidation.
|
LinkColumns |
getDependentIdLink()
Gets the id link for a dependent table.
|
java.util.ArrayList<AmberColumn> |
getIdColumns()
Returns the id columns.
|
java.util.ArrayList<LinkColumns> |
getIncomingLinks() |
AmberCompletion |
getInvalidateCompletion()
Returns the table's invalidation.
|
java.lang.String |
getLocation()
Returns the location.
|
java.lang.String |
getName()
Gets the sql table name.
|
java.util.ArrayList<LinkColumns> |
getOutgoingLinks() |
EntityType |
getType()
Gets the entity type.
|
AmberCompletion |
getUpdateCompletion()
Returns the table's invalidation.
|
boolean |
hasListeners()
Returns true if there are any listeners.
|
boolean |
isCascadeDelete()
Returns true if any deletes of this object are cascaded.
|
boolean |
isReadOnly()
Returns true if read-only
|
boolean |
removeColumn(AmberColumn column)
Remove a given column.
|
void |
setCacheTimeout(long timeout)
Sets the cache timeout.
|
void |
setConfigLocation(java.lang.String location)
Sets the config location.
|
void |
setDependentIdLink(LinkColumns link)
Sets the id link for a dependent table.
|
void |
setReadOnly(boolean isReadOnly)
Sets true if read-only
|
void |
setType(EntityType type)
Sets the entity type.
|
java.lang.String |
toString()
Printable version of the entity.
|
void |
validateDatabaseTable(AmberPersistenceUnit amberPersistenceUnit)
Creates the table if missing.
|
public AmberTable(AmberPersistenceUnit manager, java.lang.String name)
public java.util.ArrayList<LinkColumns> getIncomingLinks()
public java.util.ArrayList<LinkColumns> getOutgoingLinks()
public java.lang.String getName()
public void setConfigLocation(java.lang.String location)
public java.lang.String getLocation()
public AmberPersistenceUnit getAmberManager()
public void setType(EntityType type)
public EntityType getType()
public boolean isReadOnly()
public void setReadOnly(boolean isReadOnly)
public long getCacheTimeout()
public void setCacheTimeout(long timeout)
public AmberColumn createColumn(java.lang.String name, AmberType type)
public ForeignColumn createForeignColumn(java.lang.String name, AmberColumn key)
public AmberColumn addColumn(AmberColumn column)
public java.util.ArrayList<AmberColumn> getColumns()
public boolean removeColumn(AmberColumn column)
public void addIdColumn(AmberColumn column)
public java.util.ArrayList<AmberColumn> getIdColumns()
public void setDependentIdLink(LinkColumns link)
public LinkColumns getDependentIdLink()
public void createDatabaseTable(AmberPersistenceUnit amberPersistenceUnit) throws ConfigException
ConfigException
public void validateDatabaseTable(AmberPersistenceUnit amberPersistenceUnit) throws ConfigException
ConfigException
public AmberCompletion getInvalidateCompletion()
public AmberCompletion getUpdateCompletion()
public AmberCompletion getDeleteCompletion()
public void addEntityListener(EntityListener listener)
public boolean hasListeners()
public boolean isCascadeDelete()
public void beforeEntityDelete(AmberConnection aConn, Entity entity)
protected ConfigException error(java.lang.String msg, java.lang.Throwable e)
protected java.lang.RuntimeException error(java.lang.Throwable e)
public java.lang.String toString()
toString
in class java.lang.Object