Class ColumnProperty
- java.lang.Object
-
- com.oopsclick.silk.storage.ColumnProperty
-
public class ColumnProperty extends java.lang.ObjectThe Class ColumnProperty has the property and methods to maintain the information related to a table's column.This objects gets instantiate with the information of a column tag from an ORM file.
If the property secure is set to true the data will be encrypted before passing to the client, or decrypted before passing to the database. Primary keys are marked as secure by default.
If the properties functionInsert and functionUpdate are set the data will be send to the database embedded in the set functions.
The property translation determines how the data will be translated.
If it is set to true or 1 the xml based translation method will be used, and.
if it is set to column or 2 the column based translation method will be used for the data.The nullValue property is use to determine when to send a NULL value to the database.
The property validation contains a Regular Expression to validate the data before sending to the database.
- Author:
- Italo Osorio
-
-
Constructor Summary
Constructors Constructor Description ColumnProperty()Instantiates a new columnProperty object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFunctionInsert()Gets the function insert.java.lang.StringgetFunctionUpdate()Gets the function update.java.lang.StringgetInsertAuhorization()Gets insertAuthorizationjava.lang.StringgetName()Gets the column's name.java.lang.StringgetNullValue()Gets the null value.booleangetPk()Gets the PK.intgetSecure()Gets the secure.intgetTranslation()Gets the translate.java.lang.Class<?>getType()Gets the type.java.lang.StringgetUpdateAuhorization()Gets updateAuthorizationjava.lang.StringgetValidation()Gets the validation.voidsetAuthorization(java.lang.String authorization)Sets the insertAuthorization and updateAuthorizationvoidsetFunction(java.lang.String function)Sets the function.voidsetFunctionInsert(java.lang.String function)Sets the function insert.voidsetFunctionUpdate(java.lang.String function)Sets the function update.voidsetInsertAuthorization(java.lang.String authorization)Sets the insertAuthorizationvoidsetName(java.lang.String name)Sets the column's name.voidsetNullValue(java.lang.String nullValue)Sets the null value.voidsetPk(boolean pk)Sets the PK.voidsetSecure(java.lang.String secure)Sets the secure.voidsetTranslation(java.lang.String translation)Sets the translate.voidsetType(java.lang.Class<?> type)Sets the type using a Class typevoidsetType(java.lang.String type)Sets the type using a String descriptor S : String.class N : Double.class I : Integer.class D : LocalDateTime.class T : LocalTime.class P : Password.classvoidsetUpdateAuthorization(java.lang.String authorization)Sets the updateAuthorizationvoidsetValidation(java.lang.String validation)Sets the validation.java.lang.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the column's name.- Returns:
- the name
-
setName
public void setName(java.lang.String name)
Sets the column's name.- Parameters:
name- The new name
-
getType
public java.lang.Class<?> getType() throws SilkExceptionGets the type.- Returns:
- the type
- Throws:
SilkException- the silk exception
-
setType
public void setType(java.lang.String type) throws SilkExceptionSets the type using a String descriptor S : String.class N : Double.class I : Integer.class D : LocalDateTime.class T : LocalTime.class P : Password.class- Parameters:
type- the new type- Throws:
SilkException- the silk exception
-
setType
public void setType(java.lang.Class<?> type) throws SilkExceptionSets the type using a Class type- Parameters:
type- the Class type- Throws:
SilkException- the silk exception
-
getPk
public boolean getPk()
Gets the PK.- Returns:
- the PK
-
setPk
public void setPk(boolean pk)
Sets the PK.- Parameters:
pk- the new PK
-
getSecure
public int getSecure()
Gets the secure. 0: Not encrypted 1: Fixed encryption 2: Unique encryption- Returns:
- the secure
-
setSecure
public void setSecure(java.lang.String secure)
Sets the secure.- Parameters:
secure- the new secure
-
getNullValue
public java.lang.String getNullValue()
Gets the null value.- Returns:
- the null value
-
setNullValue
public void setNullValue(java.lang.String nullValue)
Sets the null value.- Parameters:
nullValue- the new null value
-
getTranslation
public int getTranslation()
Gets the translate.- Returns:
- the translate
-
setTranslation
public void setTranslation(java.lang.String translation) throws SilkExceptionSets the translate.- Parameters:
translation- the new translate status- Throws:
SilkException- the silk exception
-
setFunction
public void setFunction(java.lang.String function)
Sets the function.- Parameters:
function- the new function
-
getFunctionInsert
public java.lang.String getFunctionInsert()
Gets the function insert.- Returns:
- the function insert
-
setFunctionInsert
public void setFunctionInsert(java.lang.String function)
Sets the function insert.- Parameters:
function- the new function insert
-
getFunctionUpdate
public java.lang.String getFunctionUpdate()
Gets the function update.- Returns:
- the function update
-
setFunctionUpdate
public void setFunctionUpdate(java.lang.String function)
Sets the function update.- Parameters:
function- the new function update
-
getValidation
public java.lang.String getValidation()
Gets the validation.- Returns:
- the validation
-
setValidation
public void setValidation(java.lang.String validation)
Sets the validation.- Parameters:
validation- the new validation
-
setAuthorization
public void setAuthorization(java.lang.String authorization) throws SilkExceptionSets the insertAuthorization and updateAuthorization- Parameters:
authorization- string- Throws:
SilkException- the exception
-
getInsertAuhorization
public java.lang.String getInsertAuhorization()
Gets insertAuthorization- Returns:
- the authorization
-
setInsertAuthorization
public void setInsertAuthorization(java.lang.String authorization) throws SilkExceptionSets the insertAuthorization- Parameters:
authorization- string- Throws:
SilkException- the exception
-
getUpdateAuhorization
public java.lang.String getUpdateAuhorization()
Gets updateAuthorization- Returns:
- the authorization
-
setUpdateAuthorization
public void setUpdateAuthorization(java.lang.String authorization) throws SilkExceptionSets the updateAuthorization- Parameters:
authorization- string- Throws:
SilkException- the exception
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-