public class SQLColumn extends Object implements Serializable, Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected String |
columnName
The name of the column.
|
protected int |
columnSQLSize
The SQL size of the column.
|
protected int |
columnSQLType
The SQl Type of the column.
|
protected Object |
defaultValue
The default value to this column.
|
protected boolean |
primaryKey
Parameter that indicates if the column is PRIMARY KEY.
|
protected boolean |
required
Parameter that indicates if the column is required, that is, if it
accepts or not Null values.
|
protected boolean |
unique
Parameter that indicates if the column is UNIQUE.
|
| Constructor and Description |
|---|
SQLColumn(String columnName,
int columnSQLType)
Creates a new
SQLColumn indicating the name of the column
and the SQL Type of it. |
SQLColumn(String columnName,
int columnSQLType,
boolean primaryKey)
Creates a new
SQLColumn indicating the name of the column,
the SQL Type of it and the parameter primaryKey. |
SQLColumn(String columnName,
int columnSQLType,
boolean primaryKey,
boolean required)
Creates a new
SQLColumn indicating the name of the column,
the SQL Type of it, the parameter primaryKey and the parameter required. |
| Modifier and Type | Method and Description |
|---|---|
String |
getColumnName()
Returns the name of the column.
|
int |
getColumnSQLSize()
Returns the SQL size of the column.
|
int |
getColumnSQLType()
Returns the SQL Type of the column.
|
Object |
getDefaultValue()
Returns the default value to this column.
|
boolean |
isPrimaryKey()
Checks if the current column is part of a Primary Key.
|
boolean |
isRequired()
Checks if the current column is required.
|
boolean |
isUnique()
Checks if the current column is unique.
|
void |
setColumnName(String columnName)
Sets the name of the column.
|
void |
setColumnSQLSize(int columnSQLSize)
Sets the SQL size of the column.
|
void |
setColumnSQLType(int columnSQLType)
Sets the SQL Type of the column.
|
void |
setDefaultValue(Object defaultValue)
Sets de default value to this column.
|
void |
setPrimaryKey(boolean primaryKey)
Sets the value of the parameter primaryKey.
|
void |
setRequired(boolean required)
Sets the value of the parameter required.
|
void |
setUnique(boolean unique)
Sets the value of the parameter unique.
|
protected String columnName
protected int columnSQLType
protected int columnSQLSize
protected boolean unique
protected boolean primaryKey
protected boolean required
protected Object defaultValue
public SQLColumn(String columnName, int columnSQLType)
SQLColumn indicating the name of the column
and the SQL Type of it.columnName - The name of the column.columnSQLType - The int value to the SQL Type.public SQLColumn(String columnName, int columnSQLType, boolean primaryKey)
SQLColumn indicating the name of the column,
the SQL Type of it and the parameter primaryKey. If this parameter is
true this column will be set as Primary Key.columnName - The name of the column.columnSQLType - The int value to the SQL Type.primaryKey - The value of parameter primaryKey. If it is true the column
will be set as Primary Key.public SQLColumn(String columnName, int columnSQLType, boolean primaryKey, boolean required)
SQLColumn indicating the name of the column,
the SQL Type of it, the parameter primaryKey and the parameter required.
If the parameter prikaryKey is true this column will be set as Primary
Key. As well if the parameter required is true, the column will be set as
Required, that is, it doesn't admit null values.columnName - The name of the column.columnSQLType - The int value to the SQL Type.primaryKey - The value of parameter primaryKey. If it is true the column
will be set as Primary Key.required - The value of parameter required. If it is true the column will
be set as Required (doesn't admit null values).public String getColumnName()
String with the column's name.public void setColumnName(String columnName)
columnName - String with the name of the column.public int getColumnSQLType()
int with the column's SQL Type.public void setColumnSQLType(int columnSQLType)
columnSQLType - An int with the SQL Type to this column.public boolean isPrimaryKey()
booleanpublic void setPrimaryKey(boolean primaryKey)
primaryKey - A boolean that sets the value of the parameter primaryKey.public boolean isRequired()
booleanpublic void setRequired(boolean required)
required - A boolean that sets the value of the parameter required.public Object getDefaultValue()
Object with the default value.public void setDefaultValue(Object defaultValue)
defaultValue - Object with the default value.public int getColumnSQLSize()
int with the SQL size of the column.public void setColumnSQLSize(int columnSQLSize)
columnSQLSize - int with the SQL size of the column.public boolean isUnique()
booleanpublic void setUnique(boolean unique)
unique - A boolean that sets the value of the parameter unique.Copyright © 2016 Imatia Innovation S.L.. All rights reserved.