Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improved type-mapping for numbers #273
Current Type contains only mapping from SQL type to Java class. SQL type number has many mapping alternatives depending on precision and scale. For example number(19) should be mapped to Long but number(19,4) to BigDecimal.
Would it be possible to extend Type interface and related metadata exporters/configurations to allow using precision and scale in mapping?
In DatabaseMetaData.getColumns ResultSet we have
7 COLUMN_SIZE int => column size. = precision
Perhaps this extended type mapping interface could utilize all available column metadata for maximum expressivity?
Is there a standard mapping available? Based on Hibernate's OracleDialect and this I came up with this
If the mapping interface would support all metadata then it would probably need to be a callback signature, which would be expressive, but would be a major refactoring.
I'd start with a mapping that can be tuned via the Configuration interface.