|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.extensions.SuperAbstractUjo
org.ujorm.extensions.AbstractUjo
org.ujorm.orm.AbstractMetaModel
org.ujorm.orm.metaModel.MetaRelation2Many
org.ujorm.orm.metaModel.MetaColumn
public final class MetaColumn
Database column meta-data
| Field Summary | |
|---|---|
static String |
AUTO_INDEX_NAME
A constant for an auto index name |
static Key<MetaColumn,String> |
COMMENT
Comment of the database column |
static Key<MetaColumn,String> |
CONSTRAINT_NAME
A name of the constraint for the case a foreign key |
static Key<MetaColumn,Class<? extends ITypeService>> |
CONVERTER
Convert, save and read application data from/to the database |
static Key<MetaColumn,DbType> |
DB_TYPE
Database Type |
static Key<MetaColumn,String> |
DEFAULT_VALUE
DB Default value |
static Key<MetaColumn,String> |
INDEX
A name of the non-unique database index for the column, where the same index can contain more columns. |
static Key<MetaColumn,Boolean> |
MANDATORY
Column NOT-NULL |
static Key<MetaColumn,Integer> |
MAX_LENGTH
Column value length |
static Key<MetaColumn,Integer> |
PRECISION
Column value precision |
static Key<MetaColumn,Boolean> |
PRIMARY_KEY
DB primary key |
static Key<MetaColumn,String> |
UNIQUE_INDEX
A name of the unique database index for the column, where the same index can contain more columns. |
| Fields inherited from class org.ujorm.orm.metaModel.MetaRelation2Many |
|---|
ID, NAME, TABLE, TABLE_KEY |
| Constructor Summary | |
|---|---|
MetaColumn()
|
|
MetaColumn(ITypeService converter)
|
|
MetaColumn(MetaTable table,
Key tableProperty,
MetaColumn param)
|
|
| Method Summary | |
|---|---|
ColumnWrapper |
addTableAlias(String alias)
Create new object column for the new alias |
String |
getColumnAlias()
Returns a full SQL column alias name by sample: "TABLE_ALIAS"."ORIG_COLUMN" |
String |
getComment()
Get a Comment from meta-model annotation. |
String |
getConstraintName()
Returns a constraint name for case a foreigh key |
ITypeService |
getConverter()
Returna not null converter |
Class |
getDbTypeClass()
Returns a native database code for a DDL statements |
Class |
getDialectClass()
Returns a SQL dialect class from a related Database |
String |
getDialectName()
Returns a SQL dialect class from a related Database |
String |
getForeignColumnName(int index)
Returns a name of foreign column by index |
List<MetaColumn> |
getForeignColumns()
Returns an original foreign columns in case a foreign column. |
MetaTable |
getForeignTable()
Returns an original foreign columns in case a foreign column. |
String |
getFullName()
Returns a DB, TABLE and COLUMN name |
Object |
getJdbcFriendlyDefaultValue()
Returns a default value in a JDBC friendly type. |
int |
getMaxLength()
Returns a maximal db column length in the database. |
MetaColumn |
getModel()
Get link to a column meta-model |
String |
getName()
Returns a column name |
int |
getPrecision()
Returns the db column precision. |
Class |
getType()
Returns a Java Class of value |
char |
getTypeCode()
A TypeCode |
Object |
getValue(OrmUjo bo)
Returns a key value from a table |
boolean |
hasDefaultValue()
Has the key a default value (not null) ? If the default value is an empty String than method returns false. |
void |
initTypeCode()
Initialize a type code - for an internal use only. |
boolean |
isColumn()
It is a DB column (either a value of a foreign key), not a relation to many. |
boolean |
isCommented()
Has the instance assigned a non empty comment? |
boolean |
isForeignKey()
Is it a Foreign Key ? |
boolean |
isMandatory()
Returns true if the related db column is NOT NULL. |
boolean |
isPrimaryKey()
Is it a Primary Key? |
boolean |
isVoid()
Is the related key type void? |
void |
printForeignColumnFullName(int index,
Appendable out)
Print a full 'alias' name of foreign column by index |
void |
setValue(Ujo bo,
Object value)
Returns a key value from a table |
| Methods inherited from class org.ujorm.orm.metaModel.MetaRelation2Many |
|---|
equals, getHandler, getKey, getTable, getTableAlias, getTableClass, getValue, hashCode, isCompositeKey, isTypeOf, toString |
| Methods inherited from class org.ujorm.orm.AbstractMetaModel |
|---|
changeDefault, checkReadOnly, clearReadOnly, get, lock, readAuthorization, readOnly, setReadOnly, writeValue |
| Methods inherited from class org.ujorm.extensions.AbstractUjo |
|---|
newCamelFactory, newFactory, readValue |
| Methods inherited from class org.ujorm.extensions.SuperAbstractUjo |
|---|
clone, init, init, readKeys, readUjoManager, readValueString, writeValueString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.ujorm.orm.ColumnWrapper |
|---|
equals, getKey, getTableAlias, isCompositeKey |
| Methods inherited from interface org.ujorm.Ujo |
|---|
readKeys, readValue |
| Field Detail |
|---|
public static final String AUTO_INDEX_NAME
public static final Key<MetaColumn,Boolean> PRIMARY_KEY
public static final Key<MetaColumn,DbType> DB_TYPE
public static final Key<MetaColumn,Boolean> MANDATORY
public static final Key<MetaColumn,Integer> MAX_LENGTH
public static final Key<MetaColumn,Integer> PRECISION
public static final Key<MetaColumn,String> DEFAULT_VALUE
public static final Key<MetaColumn,String> INDEX
public static final Key<MetaColumn,String> UNIQUE_INDEX
public static final Key<MetaColumn,String> CONSTRAINT_NAME
public static final Key<MetaColumn,Class<? extends ITypeService>> CONVERTER
public static final Key<MetaColumn,String> COMMENT
| Constructor Detail |
|---|
public MetaColumn()
public MetaColumn(ITypeService converter)
public MetaColumn(MetaTable table,
Key tableProperty,
MetaColumn param)
| Method Detail |
|---|
public boolean isColumn()
isColumn in class MetaRelation2Manypublic boolean isForeignKey()
isForeignKey in class MetaRelation2Manypublic boolean isPrimaryKey()
public boolean isCommented()
public String getComment()
Commentpublic int getMaxLength()
public int getPrecision()
public boolean isMandatory()
public MetaTable getForeignTable()
public List<MetaColumn> getForeignColumns()
public String getForeignColumnName(int index)
public Object getValue(OrmUjo bo)
public void setValue(Ujo bo,
Object value)
ujo - Related Ujo objectvalue - A value to assign.public Class getType()
public final String getName()
getName in interface ColumnWrapperpublic String getFullName()
public String getColumnAlias()
public void printForeignColumnFullName(int index,
Appendable out)
throws IOException
IOExceptionpublic char getTypeCode()
TypeServicepublic boolean hasDefaultValue()
public Object getJdbcFriendlyDefaultValue()
ITypeServicepublic Class getDialectClass()
public String getDialectName()
public void initTypeCode()
public boolean isVoid()
public String getConstraintName()
public ITypeService getConverter()
public Class getDbTypeClass()
public MetaColumn getModel()
getModel in interface ColumnWrapperpublic final ColumnWrapper addTableAlias(String alias)
alias - Nullable alias value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||