|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Implementors of this interface represent columns in the table represented by the domain subclass.
Fields inherited from interface com.is.jrf.JRFConstants |
CURRENT_DATE, CURRENT_TIMESTAMP, DEFAULT_TO_EMPTY_STRING, DEFAULT_TO_FALSE, DEFAULT_TO_NOW, DEFAULT_TO_NULL, DEFAULT_TO_ONE, DEFAULT_TO_TODAY, DEFAULT_TO_TRUE, DEFAULT_TO_ZERO, EQUALS, NATURAL_PRIMARY_KEY, NO_POST_FIND, NOT_EQUALS, OPTIMISTIC_LOCK, REQUIRED, SEQUENCED_PRIMARY_KEY, SUBTYPE_IDENTIFIER, UNIQUE |
Method Summary | |
java.lang.String |
buildNameValuePair(java.lang.Object pkOrPersistentObject,
java.lang.String separator,
java.lang.String tableName,
DatabasePolicy dbPolicy)
This method is used to build an equals (or not-equals) String for WHERE clauses and UPDATE statements. |
java.lang.String |
buildWhereClause(java.lang.Object pkOrPersistentObject,
java.lang.String separator,
java.lang.String tableName,
DatabasePolicy dbPolicy)
Note: This method is overridden by CompoundPrimaryKeyColumnSpec to include " AND " between each name-value pair. |
java.lang.String |
columnDefinitionString(DatabasePolicy dbPolicy)
|
void |
copyAttribute(PersistentObject aPO1,
PersistentObject aPO2)
Copy the attribute I represent from one persistent object to another. |
void |
copyColumnValueToPersistentObject(JDBCHelper helper,
PersistentObject aPO)
Copy the value of my column to the appropriate attribute for this persistent object. |
void |
decodeToPersistentObject(java.lang.String aString,
PersistentObject aPO)
This method does the reverse of encodeFromPersistentObject(aPO) |
java.lang.String |
encodeFromPersistentObject(PersistentObject aPO)
Convert the attribute(s) in the given PersistentObject to a String that can be decoded later. |
java.lang.String |
formatForSql(java.lang.Object obj,
DatabasePolicy dbPolicy)
Returns a string representing the given attribute value. |
java.lang.Class |
getColumnClass()
See IntegerColumnSpec for how to implement. |
java.lang.String |
getColumnName()
|
java.lang.Object |
getColumnValueFrom(JDBCHelper helper)
See IntegerColumnSpec for how to implement: |
java.lang.Object |
getDefault()
|
java.lang.String |
getFullyQualifiedColumnName(java.lang.String tableAlias)
|
java.lang.String |
getGetter()
|
java.lang.String |
getSetter()
|
java.lang.String |
getSqlValueFrom(PersistentObject aPO,
DatabasePolicy dbPolicy)
Get a string representation of the value of this attribute from aPO. |
java.lang.Object |
getValueFrom(PersistentObject aPO)
Get the value of this attribute from aPO. |
boolean |
isNaturalPrimaryKey()
|
boolean |
isOptimisticLock()
|
boolean |
isPrimaryKey()
|
boolean |
isRequired()
|
boolean |
isSequencedPrimaryKey()
|
boolean |
isSubtypeIdentifier()
|
boolean |
isUnique()
|
void |
setRequired(boolean b)
CompoundPrimaryKeyColumnSpec uses this to force it's children to "REQUIRED". |
void |
setValueTo(java.lang.Object aValue,
PersistentObject aPO)
This is a pass-through method that passes along my setter and column class. |
java.lang.Object |
validateRequired(PersistentObject aPO)
Make sure the PersistentObject object has this attribute (if required). |
void |
validateUnique(PersistentObject aPO,
JDBCHelper helper,
ColumnSpec pkColumnSpec,
DatabasePolicy dbPolicy,
java.lang.String tableName)
If Column is declared UNIQUE, make sure it doesn't already exist in the table. |
Method Detail |
public java.lang.String formatForSql(java.lang.Object obj, DatabasePolicy dbPolicy)
obj
- a value of type 'Object'public java.lang.Class getColumnClass()
public java.lang.Object getColumnValueFrom(JDBCHelper helper) throws java.sql.SQLException
public void copyColumnValueToPersistentObject(JDBCHelper helper, PersistentObject aPO) throws java.sql.SQLException
helper
- a value of type 'JDBCHelper'aPO
- a value of type 'PersistentObject'java.sql.SQLException
- if an error occurspublic void copyAttribute(PersistentObject aPO1, PersistentObject aPO2)
aPO1
- a value of type 'PersistentObject'aPO2
- a value of type 'PersistentObject'public java.lang.String buildWhereClause(java.lang.Object pkOrPersistentObject, java.lang.String separator, java.lang.String tableName, DatabasePolicy dbPolicy)
aPO
- a value of type 'PersistentObject'separator
- a value of type 'String'tableName
- a value of type 'String'dbPolicy
- a value of type 'DatabasePolicy'public java.lang.String buildNameValuePair(java.lang.Object pkOrPersistentObject, java.lang.String separator, java.lang.String tableName, DatabasePolicy dbPolicy)
pkOrPersistentObject
- a value of type 'Object'separator
- a value of type 'String' - use EQUALS or NOT_EQUALS
static final variables.tableName
- a value of type 'String'dbPolicy
- a value of type 'DatabasePolicy'public java.lang.Object validateRequired(PersistentObject aPO) throws MissingAttributeException
aPO
- a value of type 'PersistentObject'MissingAttributeException
- if attribute should be populated
and it is not.public void validateUnique(PersistentObject aPO, JDBCHelper helper, ColumnSpec pkColumnSpec, DatabasePolicy dbPolicy, java.lang.String tableName) throws DuplicateRowException
aPO
- a value of type 'PersistentObject'helper
- a value of type 'JDBCHelper'pkColumnSpec
- a value of type 'ColumnSpec'DuplicateRowException
- if a row with this value already exists.public java.lang.String getSqlValueFrom(PersistentObject aPO, DatabasePolicy dbPolicy)
aPO
- a value of type 'PersistentObject'public java.lang.Object getValueFrom(PersistentObject aPO)
aPO
- a value of type 'PersistentObject'public void setValueTo(java.lang.Object aValue, PersistentObject aPO)
aValue
- a value of type 'Object'aPO
- a value of type 'PersistentObject'public java.lang.String encodeFromPersistentObject(PersistentObject aPO)
aPO
- a value of type 'PersistentObject'public void decodeToPersistentObject(java.lang.String aString, PersistentObject aPO)
aString
- a value of type 'String'aPO
- a value of type 'PersistentObject'public java.lang.String getFullyQualifiedColumnName(java.lang.String tableAlias)
public java.lang.String getColumnName()
public java.lang.String getGetter()
public java.lang.String getSetter()
public boolean isRequired()
public boolean isSequencedPrimaryKey()
public boolean isNaturalPrimaryKey()
public boolean isPrimaryKey()
public boolean isUnique()
public boolean isSubtypeIdentifier()
public java.lang.Object getDefault()
public boolean isOptimisticLock()
public void setRequired(boolean b)
public java.lang.String columnDefinitionString(DatabasePolicy dbPolicy)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |