public class AmberColumn
extends java.lang.Object
Constructor and Description |
---|
AmberColumn(AmberTable table,
java.lang.String name,
AmberType type)
Creates the column.
|
Modifier and Type | Method and Description |
---|---|
protected ConfigException |
error(java.lang.String msg,
java.lang.Throwable e) |
java.lang.String |
generateInsertName()
Generates the insert name.
|
int |
generateLoad(JavaWriter out,
java.lang.String rs,
java.lang.String indexVar,
int index)
Generates a string to load the type as a property.
|
int |
generateLoadNative(JavaWriter out,
int index)
Generates a string to load the type as a property.
|
java.lang.String |
generateMatchArgWhere(java.lang.String id)
Generates the where clause.
|
void |
generateNativeColumnNames(java.util.ArrayList<java.lang.String> names)
Generates a string to load the type as a property.
|
void |
generatePrologue(JavaWriter out)
Generates the prologue.
|
java.lang.String |
generateSelect(java.lang.String id)
Generates the clause to load the column.
|
void |
generateSet(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String value)
Generates a string to load the type as a property.
|
void |
generateSetVersion(JavaWriter out,
java.lang.String pstmt,
java.lang.String index,
java.lang.String value)
Generates a string to load the type as a property.
|
java.lang.String |
generateUpdateSet()
Generates the update clause.
|
java.lang.String |
generateUpdateSetNull()
Generates the update clause setting to null.
|
java.lang.String |
getFieldName()
Returns the field name.
|
int |
getLength()
Gets the length property.
|
java.lang.String |
getName()
Gets the column name.
|
int |
getPrecision()
Gets the precision property.
|
int |
getScale()
Get the scale property
|
java.lang.String |
getSQLType()
Gets the sql type for the create table
|
AmberTable |
getTable()
Returns the owning table.
|
AmberType |
getType()
Returns the type.
|
boolean |
isNotNull()
Gets the not-null property.
|
boolean |
isPrimaryKey()
Return true for a primary key column.
|
boolean |
isUnique()
Gets the unique property.
|
void |
setConfigLocation(java.lang.String location)
Sets the config location.
|
void |
setGeneratorType(java.lang.String type)
Sets the generator type.
|
void |
setLength(int length)
Sets the length property.
|
void |
setName(java.lang.String name)
Sets the column name.
|
void |
setNotNull(boolean isNotNull)
Sets the not-null property.
|
void |
setPrecision(int precision)
Set the precision property.
|
void |
setPrimaryKey(boolean isPrimaryKey)
Sets the primary key property.
|
void |
setScale(int scale)
Set the scale property
|
void |
setSQLType(java.lang.String sqlType)
Sets the sql type for create table
|
void |
setUnique(boolean isUnique)
Sets the unique property.
|
java.lang.Object |
toObjectKey(long value)
Converts to the object key.
|
java.lang.String |
toString()
Returns the name.
|
public AmberColumn(AmberTable table, java.lang.String name, AmberType type)
table
- the owning tablename
- the column sql nametype
- the column's typepublic AmberTable getTable()
public java.lang.String getName()
public void setName(java.lang.String name)
public void setConfigLocation(java.lang.String location)
public AmberType getType()
public void setPrimaryKey(boolean isPrimaryKey)
public boolean isPrimaryKey()
public void setGeneratorType(java.lang.String type)
public java.lang.String generateInsertName()
public void setSQLType(java.lang.String sqlType)
public java.lang.String getSQLType()
public void setLength(int length)
public int getLength()
public void setNotNull(boolean isNotNull)
public boolean isNotNull()
public void setPrecision(int precision)
public int getPrecision()
public void setScale(int scale)
public int getScale()
public void setUnique(boolean isUnique)
public boolean isUnique()
public java.lang.String generateSelect(java.lang.String id)
public java.lang.String generateMatchArgWhere(java.lang.String id)
public java.lang.String generateUpdateSet()
public java.lang.String generateUpdateSetNull()
public void generatePrologue(JavaWriter out) throws java.io.IOException
java.io.IOException
public java.lang.String getFieldName()
public void generateSet(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String value) throws java.io.IOException
java.io.IOException
public void generateSetVersion(JavaWriter out, java.lang.String pstmt, java.lang.String index, java.lang.String value) throws java.io.IOException
java.io.IOException
public int generateLoad(JavaWriter out, java.lang.String rs, java.lang.String indexVar, int index) throws java.io.IOException
java.io.IOException
public int generateLoadNative(JavaWriter out, int index) throws java.io.IOException
java.io.IOException
public void generateNativeColumnNames(java.util.ArrayList<java.lang.String> names)
public java.lang.Object toObjectKey(long value)
protected ConfigException error(java.lang.String msg, java.lang.Throwable e)
public java.lang.String toString()
toString
in class java.lang.Object