com.tenduke.binding.sql
Class SqlDocumentInfo

java.lang.Object
  extended by com.tenduke.binding.sql.JdbcBindObject<T>
      extended by com.tenduke.binding.sql.SqlMediaInfo<DocumentInfo>
          extended by com.tenduke.binding.sql.SqlDocumentInfo
All Implemented Interfaces:
JdbcDataSourceQuery<DocumentInfo>, JdbcDataSourceWriter<DocumentInfo>, DataSourceQuery<DocumentInfo>, DataSourceWriter<DocumentInfo>, SerializableObject

public class SqlDocumentInfo
extends SqlMediaInfo<DocumentInfo>


Nested Class Summary
 
Nested classes/interfaces inherited from class com.tenduke.binding.sql.SqlMediaInfo
SqlMediaInfo.MediaInfoResultSetConsumer<T extends MediaInfo,U extends AbstractBindableObject>
 
Nested classes/interfaces inherited from class com.tenduke.binding.sql.JdbcBindObject
JdbcBindObject.DefaultResultSetConsumer<T extends AbstractBindableObject,U extends AbstractBindableObject>, JdbcBindObject.StatementValueSerializationStyle
 
Field Summary
 
Fields inherited from class com.tenduke.binding.sql.JdbcBindObject
CreatedByProfileIdFieldName, CreatedTimestampFieldName, ModifiedByProfileIdFieldName, ModifiedTimestampFieldName, NestedQueryFormatSpecifierForCategoryIds, NestedQueryFormatSpecifierForCreatedByIds, NestedQueryFormatSpecifierForModifiedByIds, NestedQueryFormatSpecifierForPrimaryKeys, QUERY_STRING_CONSTANT_SELECT_SPACE, QUERY_STRING_CONSTANT_SPACE_AND_SPACE, QUERY_STRING_CONSTANT_SPACE_FROM_SPACE, QUERY_STRING_CONSTANT_SPACE_IN_SPACE, QUERY_STRING_CONSTANT_SPACE_LIKE, QUERY_STRING_CONSTANT_SPACE_LOWER, QUERY_STRING_CONSTANT_SPACE_OR_SPACE, QUERY_STRING_CONSTANT_SPACE_WHERE_SPACE, SortByCreated, SortByModified
 
Constructor Summary
SqlDocumentInfo()
          Initializes new instance of the SqlDocumentInfo class.
SqlDocumentInfo(java.lang.String tableName)
          Initializes new instance of the SqlDocumentInfo class.
SqlDocumentInfo(java.lang.String tableName, DocumentInfo documentInfo)
          Initializes new instance of the SqlDocumentInfo class.
SqlDocumentInfo(java.lang.String tableName, java.lang.String primaryKeyName, DocumentInfo documentInfo)
          Initializes new instance of the SqlDocumentInfo class.
 
Method Summary
 DocumentInfo createObject()
           
 void createTable(AbstractJdbcDatabase database)
          Fields for binding:
primaryKeyName propertyValue propertyTimestamp
 void createTable(AbstractJdbcDatabase aDatabase, java.lang.String tableName, java.lang.String primaryKeyName)
          Fields for binding:
primaryKeyName propertyValue propertyTimestamp
 DocumentInfo fromJdbcResultSetRow(java.sql.ResultSet resultSetRow)
          Construct an object model object from a JDBC result set row.
<T extends DocumentInfo>
T
fromSqlRow(java.sql.ResultSet resultSet, T resultObject, java.lang.String primaryKeyName, java.lang.String entryForeignKeyName)
           
 java.lang.String getDefaultPrimaryKeyName()
           
 java.lang.String getDefaultTableName()
           
static java.lang.String getOwnerForeignKeyFieldName(java.lang.String tableName)
          Gets name of foreign key field that is used to refer to the table that owns (=aggregates) this table.
static java.lang.String getOwnerTableName(java.lang.String tableName)
          Gets name of the table that owns (=aggregates) this table.
protected  int valuesToStatement(java.lang.StringBuilder sb, java.util.List<AbstractValueByTypeSetter> preparedStatementValues, DocumentInfo object, java.lang.String tableName, java.lang.String primaryKeyName, JdbcBindObject.StatementValueSerializationStyle valueSerializationStyle, java.util.List<java.lang.String> fieldsToWrite, int valueIndex)
          Write values of object fields to an SQL statement based on SerializableField annotations.
 
Methods inherited from class com.tenduke.binding.sql.SqlMediaInfo
getQueryResultSetConsumer
 
Methods inherited from class com.tenduke.binding.sql.JdbcBindObject
addCommonFieldsForCreateTable, addConstraintsForCreateTable, addCreatedAndModifiedFieldsForCreateTable, annotatedFieldNameToFieldName, appendColumnToCreateTableStatement, buildAggregatedObjectQueryString, buildAggregatedObjectQueryString, buildAggregatedObjectQueryString, buildAggregatedObjectQueryString, buildAggregatedObjectQueryString, buildAggregatedObjectQueryString, buildAggregatingObjectQueryString, buildAggregatingObjectQueryString, buildAggregatingObjectQueryString, buildAggregatingObjectQueryString, buildAggregatingObjectQueryString, buildAggregatingObjectQueryString, buildAllObjectsInTimeFrameQueryString, buildAllObjectsQueryString, buildAllObjectsQueryString, buildAllObjectsQueryString, buildAllObjectsQueryString, buildAllObjectsQueryString, buildAllObjectsQueryString, buildByFieldNameAndFieldValueStartsWithQueryString, buildByFieldNameAndFieldValueStartsWithQueryString, buildByFieldNameCountQueryString, buildByFieldNameQueryString, buildByFieldNameQueryString, buildByFieldNameQueryString, buildByFieldNameQueryString, buildByFieldNameQueryString, buildByFieldNameQueryString, buildByFieldNamesQueryString, buildByFieldNamesQueryString, buildByFieldNamesQueryString, buildByFieldNamesQueryString, buildByFieldNamesQueryString, buildCountByFieldNameQueryString, buildCountByFieldNameQueryString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildCountQueryViaConnectingTableStatementString, buildDefaultPrimaryKeyName, buildDirectChildrenQueryString, buildDirectChildrenQueryString, buildDirectChildrenQueryString, buildDirectChildrenQueryString, buildLimitOffsetSection, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString, buildNestedQueryViaConnectingTableStatementString2, buildNestedQueryViaConnectingTableStatementString2, buildNestedQueryViaConnectingTableStatementString2, buildObjectBySubselectEnd, buildObjectBySubselectStart, buildObjectBySubselectStart, buildObjectCountQueryString, buildObjectCountQueryString, buildObjectCountQueryStringForCreatedByProfile, buildObjectCountQueryStringForModifiedByProfile, buildOrderByTailSection, buildOrderByTailSection, buildPrimaryKeyQueryString, buildPrimaryKeyQueryString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildQueryViaConnectingTableStatementString, buildWhereClauseByPrimaryKey, changeId, changeId, changeIdInDataSource, checkAndEscapeReservedFieldName, constructCreateTableStatement, constructCreateTableStatement, delete, delete, deleteFromDataSource, escapeReservedFieldName, executeQuery, expandFormatSpecifiers, fromSqlRow, getBaseTableName, getChangedFieldNames, getChildReadBindObjects, getChildWriteBindObjects, getConnection, getDatabase, getDataProvider, getDataSetElementIdentifierName, getDataSetName, getDataSetNamePrefix, getDataSourceQueryImplementation, getDataSourceWriterImplementation, getDefaultBindFieldsEnabled, getDefaultObjectCategoryIdFieldName, getDeleteAll, getFieldsToWrite, getId, getManyToManyBindObject, getManyToManyTableName, getObject, getObjectCategoryIdFieldName, getParentBasedDataSetName, getParentNode, getParentRowId, getPrimaryKeyFieldName, getSQLColumnsString, getSQLValueParameterTokens, getTypeSetterForFieldType, getWriteTheObject, insert, insertOrUpdate, isFieldChanged, isFieldNameReserved, objectToDataSource, setChildReadBindObjects, setChildWriteBindObjects, setConnection, setDatabase, setDataProvider, setDataSetName, setDataSetNamePrefix, setDefaultBindFieldsEnabled, setDeleteAll, setFieldsToWrite, setId, setObject, setParentNode, setParentRowId, setPreparedStatementValues, setSqlPrimaryKeyName, setSqlTableName, setWriteTheObject, update, valueToStatement, valueToStatement, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlDocumentInfo

public SqlDocumentInfo()
Initializes new instance of the SqlDocumentInfo class.


SqlDocumentInfo

public SqlDocumentInfo(java.lang.String tableName)
Initializes new instance of the SqlDocumentInfo class.


SqlDocumentInfo

public SqlDocumentInfo(java.lang.String tableName,
                       DocumentInfo documentInfo)
Initializes new instance of the SqlDocumentInfo class.


SqlDocumentInfo

public SqlDocumentInfo(java.lang.String tableName,
                       java.lang.String primaryKeyName,
                       DocumentInfo documentInfo)
Initializes new instance of the SqlDocumentInfo class.

Method Detail

createObject

public DocumentInfo createObject()

createTable

public void createTable(AbstractJdbcDatabase database)
                 throws java.sql.SQLException
Fields for binding:
primaryKeyName propertyValue propertyTimestamp

Throws:
java.sql.SQLException

createTable

public void createTable(AbstractJdbcDatabase aDatabase,
                        java.lang.String tableName,
                        java.lang.String primaryKeyName)
                 throws java.sql.SQLException
Fields for binding:
primaryKeyName propertyValue propertyTimestamp

Overrides:
createTable in class JdbcBindObject<DocumentInfo>
Throws:
java.sql.SQLException

fromJdbcResultSetRow

public DocumentInfo fromJdbcResultSetRow(java.sql.ResultSet resultSetRow)
Description copied from class: JdbcBindObject
Construct an object model object from a JDBC result set row. This base class implementation uses reflection to find fields annotated with SerializableField annotation in the resulting object and reads values of these annotated fields. This method may be overridden in derived classes e.g. for improving performance.

Specified by:
fromJdbcResultSetRow in interface JdbcDataSourceQuery<DocumentInfo>
Overrides:
fromJdbcResultSetRow in class JdbcBindObject<DocumentInfo>
Parameters:
resultSetRow - The row in the result set to deserialize into an object.
Returns:
Object deserialized from result row.

fromSqlRow

public <T extends DocumentInfo> T fromSqlRow(java.sql.ResultSet resultSet,
                                             T resultObject,
                                             java.lang.String primaryKeyName,
                                             java.lang.String entryForeignKeyName)

getDefaultPrimaryKeyName

public java.lang.String getDefaultPrimaryKeyName()
Specified by:
getDefaultPrimaryKeyName in class JdbcBindObject<DocumentInfo>
Returns:
default primary key name to be bound to objects of the object model type handled by this binding class

getDefaultTableName

public java.lang.String getDefaultTableName()
Specified by:
getDefaultTableName in class JdbcBindObject<DocumentInfo>
Returns:
default table name to be bound to objects of the object model type handled by this binding class

getOwnerForeignKeyFieldName

public static java.lang.String getOwnerForeignKeyFieldName(java.lang.String tableName)
Gets name of foreign key field that is used to refer to the table that owns (=aggregates) this table.

Returns:
Foreign key used to refer to owner objects.

getOwnerTableName

public static java.lang.String getOwnerTableName(java.lang.String tableName)
Gets name of the table that owns (=aggregates) this table.

Returns:
Table name used to bind owner objects.

valuesToStatement

protected int valuesToStatement(java.lang.StringBuilder sb,
                                java.util.List<AbstractValueByTypeSetter> preparedStatementValues,
                                DocumentInfo object,
                                java.lang.String tableName,
                                java.lang.String primaryKeyName,
                                JdbcBindObject.StatementValueSerializationStyle valueSerializationStyle,
                                java.util.List<java.lang.String> fieldsToWrite,
                                int valueIndex)
                         throws java.sql.SQLException
Description copied from class: JdbcBindObject
Write values of object fields to an SQL statement based on SerializableField annotations. This default implementation may be overridden in derived classes e.g. to improve performance.

Overrides:
valuesToStatement in class JdbcBindObject<DocumentInfo>
Parameters:
sb - StringBuilder into which statement is serialized
preparedStatementValues - Values for statement variables
object - The object for which fields are serialized
tableName - Table name where object is bound
primaryKeyName - Primary key name
valueSerializationStyle - Serialization style, which controls if only field names or field names and field values are serialized.
fieldsToWrite - List of field names to include
valueIndex - Number of fields written into statement before call to this method
Returns:
Number of fields written into statement after call to this method
Throws:
java.sql.SQLException