public interface Attribute extends ModelElement
Each attribute corresponds to a database column.
| Modifier and Type | Method and Description |
|---|---|
String |
getApplicationType()
Gets the application specific type.
|
String |
getBindableAnnotation()
Returns the @Bindable-annotation text.
|
String |
getColumnName()
Gets the database column name.
|
DataType |
getDataType()
Gets the data type.
|
DataType |
getEffectiveType()
Gets the effective type exposed to the backend.
If this is an application specific type, the inner type will be returned. |
Entity |
getEntity()
Gets the entity this attribute belongs to.
|
String |
getGetterName()
Gets the getter method name.
|
String |
getInnerName()
Gets the inner name.
This is either the generic inner type or the wrapped type used by application specific types, for example enums. |
DataType |
getInnerType()
Gets the innertype for application specific types.
|
String |
getJavaType()
Gets the java type.
Returns the java type with optional generic info. |
String |
getMethodNameSuffix()
Gets the suffix to be used in methodnames.
|
AttributeOptions |
getOptions()
Gets the options.
|
Relation |
getRelation()
Gets the associated relation.
|
Integer |
getScale()
Gets the scale for numbers with a fraction part.
|
int |
getScaleWithDefault()
Gets the scale width with default 0.
|
String |
getSetterName()
Gets the setter method name.
|
Integer |
getSize()
Gets the column width.
|
int |
getSizeWithDefault()
Gets the column width with default 0.
|
boolean |
isImplicit()
Returns whether attribute is implicit and not result of an attribute line configuration.
|
boolean |
isNullable()
Returns whether database column is nullable.
|
String |
toMethodArgument(String value)
Conberts a given value string to a valid java method argument.
Adds downcasts, if necessary. |
void |
validate()
Validates the attribute.
|
getName, getParent, getSourceInfoEntity getEntity()
String getColumnName()
DataType getDataType()
String getInnerName() throws ModelException
ModelException - if not an application type or innername not setInteger getSize()
For strings this is the maximum number of characters. For numerics this is only a hint for the GUI.
int getSizeWithDefault()
Integer getScale()
int getScaleWithDefault()
AttributeOptions getOptions()
boolean isImplicit()
String getApplicationType() throws ModelException
ModelException - if application specific type not set or this is not DataType.APPLICATIONDataType getInnerType() throws ModelException
ModelException - if not application specific type or innertype not a legal DataType.DataType getEffectiveType() throws ModelException
ModelException - if model garbeledString getJavaType() throws ModelException
Examples:
Date Binary<Invoice> MyType;
ModelException - if type is misconfiguredboolean isNullable()
throws ModelException
ModelException - if type is misconfiguredRelation getRelation()
void validate()
throws ModelException
ModelException - if validation failedString getMethodNameSuffix()
Example:
"set" + getMethodNameSuffix() would return "setBlah" if the javaName is "blah".
String getGetterName()
String getSetterName()
String getBindableAnnotation()
Tentackle - a domain driven enterprise framework