com.irisel.oms.olapi.internal
Class DataProperty

java.lang.Object
  extended by com.irisel.oms.olapi.internal.DataProperty
All Implemented Interfaces:
Property

public class DataProperty
extends java.lang.Object

This class is an implementation of the interface Property and represents a Database Property It inherits from AbstractDataProperty but it is particular to Database, it is built from ResultSetMetaData It is used to deal with field-level details of the OMS Data Model.


Field Summary
 
Fields inherited from interface com.irisel.oms.olapi.internal.Property
C_SYNC_DELETED, C_SYNC_MODIFIED, C_SYNC_NEW, C_SYNC_SYNCHRONIZED
 
Constructor Summary
DataProperty(DBHandler dbhandler)
          Dummy constructor
DataProperty(DBHandler dbhandler, PropertyVO pvo)
           
DataProperty(DBHandler dbh, java.sql.ResultSetMetaData rsmd, int i)
          Constructor It constructs the object based on a ResultSetMetaData field, identified by an index.
DataProperty(DBHandler dbhandler, java.lang.String name, java.lang.String title, int type, int size)
          Constructor It constructs the property directly from the parameters received
 
Method Summary
 PropertyVO buildPropertyVO(Model dm, long classId)
          Returns a PropertyVO object for this Property
 int getIndex()
          Getter for property index.
 java.lang.String getJavaClassName()
          Getter for property Java Classname
 java.lang.String getName()
          Getter for property name.
 int getNullable()
           
 java.lang.String getOriginalTable()
           
 int getSize()
          Getter for property size.
 int getSqlType()
           
 java.lang.String getSynch()
          Getter for property synch.
 java.lang.String getTitle()
          Returns property title.
 int getType()
          Returns property sql type.
 int getType1()
           
 java.lang.String getType2()
           
 java.lang.String getValidation()
           
 java.lang.Object getValue()
          Getter for property value.
 boolean isAutoincrement()
           
 boolean isCaseSensitive()
           
 boolean isPrimaryKey()
           
 boolean isReadOnly()
           
 boolean isSearchable()
           
 boolean isSigned()
           
 void setAutoincrement(boolean autoincrement)
           
 void setCaseSensitive(boolean caseSensitive)
           
 void setIndex(int index)
          Setter for property index.
 void setJavaClassName(java.lang.String javaClassName)
           
 void setName(java.lang.String name)
          Setter for property name.
 void setNullable(int nullable)
           
 void setOriginalTable(java.lang.String originalTable)
           
 void setPrimaryKey(boolean primaryKey)
           
 void setReadOnly(boolean readOnly)
           
 void setSearchable(boolean searchable)
           
 void setSigned(boolean signed)
           
 void setSize(int size)
          Setter for property size.
 void setSqlType(int sqlType)
           
 void setSynch(java.lang.String status)
          Setter for property synch.
 void setTitle(java.lang.String title)
          Sets property title.
 void setType(int type)
          Sets property type.
 void setType1(int type1)
          Sets property type1.
 void setType2(java.lang.String type2)
           
 void setValidation(java.lang.String validation)
           
 void setValue(java.lang.Object value)
          Setter for property value.
 java.lang.String toString()
          Returns a String representation of this object.
 void updateFromPropertyVO(PropertyVO pvo)
          Updates from PropertyVO information
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataProperty

public DataProperty(DBHandler dbh,
                    java.sql.ResultSetMetaData rsmd,
                    int i)
Constructor It constructs the object based on a ResultSetMetaData field, identified by an index.

Parameters:
rsmd - ResultSetMetaData, from a select query on the table related to this property
i - index of the column in the ResultSetMetaData, related to this property

DataProperty

public DataProperty(DBHandler dbhandler,
                    java.lang.String name,
                    java.lang.String title,
                    int type,
                    int size)
Constructor It constructs the property directly from the parameters received

Parameters:
name - name of the property
title - title of the property
type - type of the property, as defined in java.sql.Types
size - size of the property, when applicable

DataProperty

public DataProperty(DBHandler dbhandler)
Dummy constructor


DataProperty

public DataProperty(DBHandler dbhandler,
                    PropertyVO pvo)
Method Detail

toString

public java.lang.String toString()
Returns a String representation of this object.

Specified by:
toString in interface Property
Overrides:
toString in class java.lang.Object
Returns:
String representation of the object

getIndex

public int getIndex()
Getter for property index.

Specified by:
getIndex in interface Property
Returns:
Value of property index.

setIndex

public void setIndex(int index)
Setter for property index.

Specified by:
setIndex in interface Property
Parameters:
index - New value of property index.

getSize

public int getSize()
Getter for property size.

Specified by:
getSize in interface Property
Returns:
Value of property size.

setSize

public void setSize(int size)
Setter for property size.

Specified by:
setSize in interface Property
Parameters:
size - Sets the size of the property

getName

public java.lang.String getName()
Getter for property name.

Specified by:
getName in interface Property
Returns:
Value of property name.

setName

public void setName(java.lang.String name)
Setter for property name.

Specified by:
setName in interface Property
Parameters:
name - New value of property name.

getTitle

public java.lang.String getTitle()
Returns property title.

Specified by:
getTitle in interface Property
Returns:
Value of property title.

setTitle

public void setTitle(java.lang.String title)
Sets property title.

Specified by:
setTitle in interface Property
Parameters:
title - New value of property title.

getType

public int getType()
Returns property sql type.

Specified by:
getType in interface Property
Returns:
Value of property type.
See Also:
Types

getJavaClassName

public java.lang.String getJavaClassName()
Description copied from interface: Property
Getter for property Java Classname

Specified by:
getJavaClassName in interface Property
Returns:
the name of the property

setType

public void setType(int type)
Sets property type.

Specified by:
setType in interface Property
Parameters:
type - New value of property type.
See Also:
Types

setType1

public void setType1(int type1)
Sets property type1.

Specified by:
setType1 in interface Property
Parameters:
type - New value of property type.
See Also:
Types

getValue

public java.lang.Object getValue()
Getter for property value.

Specified by:
getValue in interface Property
Returns:
Value of property value.

setValue

public void setValue(java.lang.Object value)
Setter for property value.

Specified by:
setValue in interface Property
Parameters:
value - New value of property value.

getSynch

public java.lang.String getSynch()
Getter for property synch.

Specified by:
getSynch in interface Property
Returns:
Value of property synch.

setSynch

public void setSynch(java.lang.String status)
Setter for property synch.

Specified by:
setSynch in interface Property
Parameters:
status - the synchronization status

getNullable

public int getNullable()
Specified by:
getNullable in interface Property

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface Property

isSearchable

public boolean isSearchable()
Specified by:
isSearchable in interface Property

isAutoincrement

public boolean isAutoincrement()
Specified by:
isAutoincrement in interface Property

isCaseSensitive

public boolean isCaseSensitive()
Specified by:
isCaseSensitive in interface Property

isSigned

public boolean isSigned()
Specified by:
isSigned in interface Property

setSearchable

public void setSearchable(boolean searchable)
Specified by:
setSearchable in interface Property

setReadOnly

public void setReadOnly(boolean readOnly)
Specified by:
setReadOnly in interface Property

setNullable

public void setNullable(int nullable)
Specified by:
setNullable in interface Property

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)
Specified by:
setCaseSensitive in interface Property

setAutoincrement

public void setAutoincrement(boolean autoincrement)

setType2

public void setType2(java.lang.String type2)
Specified by:
setType2 in interface Property

getSqlType

public int getSqlType()
Specified by:
getSqlType in interface Property

setSqlType

public void setSqlType(int sqlType)
Specified by:
setSqlType in interface Property

getType1

public int getType1()
Specified by:
getType1 in interface Property

getType2

public java.lang.String getType2()
Specified by:
getType2 in interface Property

setJavaClassName

public void setJavaClassName(java.lang.String javaClassName)
Specified by:
setJavaClassName in interface Property

setSigned

public void setSigned(boolean signed)
Specified by:
setSigned in interface Property

isPrimaryKey

public boolean isPrimaryKey()
Specified by:
isPrimaryKey in interface Property

setPrimaryKey

public void setPrimaryKey(boolean primaryKey)
Specified by:
setPrimaryKey in interface Property

updateFromPropertyVO

public void updateFromPropertyVO(PropertyVO pvo)
Description copied from interface: Property
Updates from PropertyVO information

Specified by:
updateFromPropertyVO in interface Property

buildPropertyVO

public PropertyVO buildPropertyVO(Model dm,
                                  long classId)
Description copied from interface: Property
Returns a PropertyVO object for this Property

Specified by:
buildPropertyVO in interface Property

getOriginalTable

public java.lang.String getOriginalTable()
Specified by:
getOriginalTable in interface Property

setOriginalTable

public void setOriginalTable(java.lang.String originalTable)

getValidation

public java.lang.String getValidation()
Specified by:
getValidation in interface Property

setValidation

public void setValidation(java.lang.String validation)
Specified by:
setValidation in interface Property