Class MappingSupport

java.lang.Object
org.seasar.doma.internal.jdbc.command.MappingSupport

public class MappingSupport extends Object
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.
  • Constructor Details

  • Method Details

    • createIndexMap

      public Map<Integer,MappingSupport.PropType> createIndexMap(ResultSetMetaData resultSetMeta, Map<String,MappingSupport.PropType> columnNameMap) throws SQLException
      Creates a mapping of result set column indices to their corresponding property types. This method processes the column metadata and maps each column index to a PropType, 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 set
      columnNameMap - 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