java.lang.Object
org.seasar.doma.internal.jdbc.command.MappingSupport
Provides support for handling and mapping database result sets to entity properties. It ensures
proper alignment between query results and entity fields, including handling unknown columns,
duplicate columns, and unmapped entity properties.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a property mapping for an entity during result set processing.static final recordRepresents a combination of an entity type, a property type, and the property path for mapping between result set columns and properties in an entity. -
Constructor Summary
ConstructorsConstructorDescriptionMappingSupport(EntityType<?> entityType, Query query, boolean resultMappingEnsured, UnknownColumnHandler unknownColumnHandler, DuplicateColumnHandler duplicateColumnHandler) -
Method Summary
Modifier and TypeMethodDescriptioncreateIndexMap(ResultSetMetaData resultSetMeta, Map<String, MappingSupport.PropType> columnNameMap) Creates a mapping of result set column indices to their corresponding property types.
-
Constructor Details
-
MappingSupport
public MappingSupport(EntityType<?> entityType, Query query, boolean resultMappingEnsured, UnknownColumnHandler unknownColumnHandler, DuplicateColumnHandler duplicateColumnHandler)
-
-
Method Details
-
createIndexMap
public Map<Integer,MappingSupport.PropType> createIndexMap(ResultSetMetaData resultSetMeta, Map<String, MappingSupport.PropType> columnNameMap) throws SQLExceptionCreates a mapping of result set column indices to their corresponding property types. This method processes the column metadata and maps each column index to aPropType, based on the provided column name to property type mapping.Handles duplicate column names and unknown columns via the respective handlers. Throws an exception if result mapping is enforced and there are unmapped properties.
- Parameters:
resultSetMeta- the metadata of the result setcolumnNameMap- a map of lower-case column names to their corresponding property types- Returns:
- a map where keys are result set column indices and values are the corresponding property types
- Throws:
SQLException- if a database access error occurs
-