Package org.apache.cayenne.access.jdbc
Class RowDescriptorBuilder
java.lang.Object
org.apache.cayenne.access.jdbc.RowDescriptorBuilder
A builder class that helps to assemble
RowDescriptor
instances from various
types of inputs.- Since:
- 3.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected ColumnDescriptor[]
protected ResultSetMetaData
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDescriptor
(ExtendedTypeMap typeMap) Returns a RowDescriptor built based on the builder internal state.boolean
isOverriden
(String columnName) protected ColumnDescriptor[]
overrideColumnType
(String columnName, String type) setColumns
(ColumnDescriptor[] columns) Sets an explicit set of columns.setResultSet
(ResultSet resultSet) Validate and report duplicate names of columns.
-
Field Details
-
columns
-
resultSetMetadata
-
caseTransformer
-
typeOverrides
-
validateDuplicateColumnNames
protected boolean validateDuplicateColumnNames
-
-
Constructor Details
-
RowDescriptorBuilder
public RowDescriptorBuilder()
-
-
Method Details
-
getDescriptor
public RowDescriptor getDescriptor(ExtendedTypeMap typeMap) throws SQLException, IllegalStateException Returns a RowDescriptor built based on the builder internal state.- Throws:
SQLException
IllegalStateException
-
mergeResultSetAndPresetColumns
- Returns:
- array of columns for ResultSet with overriding ColumnDescriptors from 'columns' Note: column will be overlooked, if column name is empty
- Throws:
SQLException
-
setColumns
Sets an explicit set of columns. Note that the array passed as an argument can later be modified by the build to enforce column capitalization policy and columns Java types overrides. -
setResultSet
- Throws:
SQLException
-
useLowercaseColumnNames
-
useUppercaseColumnNames
-
overrideColumnType
-
validateDuplicateColumnNames
Validate and report duplicate names of columns.- Returns:
- this builder
-
isOverriden
-
mergeColumnsWithRsMetadata
-