|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javalite.activejdbc.MetaModel<T,E>
public class MetaModel<T extends Model,E extends Association>
| Constructor Summary | |
|---|---|
protected |
MetaModel(String dbName,
String tableName,
String idName,
Class<T> modelClass,
String dbType,
boolean cached,
String idGeneratorCode)
|
| Method Summary | |
|---|---|
protected void |
addAssociation(Association association)
|
boolean |
cached()
|
protected void |
checkAttributeOrAssociation(String attributeOrAssociation)
Checks if this model has a named attribute or association whose target has the same name as argument. |
E |
getAssociationForTarget(String target)
Returns association of this table with the target table. |
E |
getAssociationForTarget(String target,
Class<? extends Association> associationClass)
Returns association of this table with the target table. |
protected List<Association> |
getAssociations()
|
ArrayList<Association> |
getAssociationsForTarget(String target)
Returns associations of this table with the target table. |
protected List<String> |
getAttributeNames()
Retrieves all attribute names. |
List<String> |
getAttributeNamesSkip(String... names)
Finds all attribute names except those provided as arguments. |
List<String> |
getAttributeNamesSkipGenerated()
Finds all attribute names except generated like id, created_at, updated_at and record_version. |
List<String> |
getAttributeNamesSkipId()
Finds all attribute names except for id. |
Map<String,ColumnMetadata> |
getColumnMetadata()
Provides column metadata map, keyed by attribute names. |
String |
getDbName()
|
protected static String |
getDbName(Class<? extends Model> modelClass)
|
String |
getDbType()
|
DefaultDialect |
getDialect()
|
String |
getFKName()
FK name is a foreign key name used in relationships as a foreign key column in a child table (table represented by this instance is a parent table). |
String |
getIdGeneratorCode()
|
String |
getIdName()
|
protected List<Many2ManyAssociation> |
getManyToManyAssociations(List<Association> excludedAssociations)
|
Class<T> |
getModelClass()
|
protected List<OneToManyAssociation> |
getOneToManyAssociations(List<Association> exclusions)
|
protected List<OneToManyPolymorphicAssociation> |
getPolymorphicAssociations(List<Association> exclusions)
|
String |
getTableName()
|
protected boolean |
hasAssociation(String table,
Class<? extends Association> associationClass)
|
boolean |
isAssociatedTo(Class<? extends Model> targetModelClass)
Checks if there is association to the target model class., |
boolean |
isVersioned()
Returns true if this model supports optimistic locking, false if not |
protected boolean |
tableExists()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected MetaModel(String dbName,
String tableName,
String idName,
Class<T> modelClass,
String dbType,
boolean cached,
String idGeneratorCode)
| Method Detail |
|---|
public String getIdGeneratorCode()
public String getDbName()
public boolean cached()
public Class<T> getModelClass()
public String getTableName()
protected boolean tableExists()
public List<String> getAttributeNamesSkipId()
public List<String> getAttributeNamesSkipGenerated()
public List<String> getAttributeNamesSkip(String... names)
public boolean isVersioned()
protected List<String> getAttributeNames()
public String getIdName()
public E getAssociationForTarget(String target,
Class<? extends Association> associationClass)
target - association of this table and the target table.associationClass - class of association in requested.
public E getAssociationForTarget(String target)
target - association of this table and the target table.
public ArrayList<Association> getAssociationsForTarget(String target)
target - association of this table and the target table.
protected void addAssociation(Association association)
protected boolean hasAssociation(String table,
Class<? extends Association> associationClass)
public String toString()
toString in class Objectpublic String getFKName()
Inflector: It is a singular version of this table name plus "_id".
protected List<OneToManyAssociation> getOneToManyAssociations(List<Association> exclusions)
protected List<OneToManyPolymorphicAssociation> getPolymorphicAssociations(List<Association> exclusions)
protected List<Many2ManyAssociation> getManyToManyAssociations(List<Association> excludedAssociations)
public String getDbType()
public DefaultDialect getDialect()
protected List<Association> getAssociations()
protected void checkAttributeOrAssociation(String attributeOrAssociation)
IllegalArgumentException in case it does not find either one.
attributeOrAssociation - name of attribute or association target.protected static String getDbName(Class<? extends Model> modelClass)
public Map<String,ColumnMetadata> getColumnMetadata()
public boolean isAssociatedTo(Class<? extends Model> targetModelClass)
targetModelClass - class of a model that will be checked for association from current model.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||