[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1008) SchemaValidator mapping of double to SQL-Type DECIMAL with Precision and Scale

Julien HENRY (JIRA) noreply at atlassian.com
Mon Nov 9 07:52:09 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34489#action_34489 ] 

Julien HENRY commented on HHH-1008:
-----------------------------------

Same problem for me with Oracle 9i and Hibernate 3.5.0-Beta-2:

Mapping is:
    @Column(name="DATE_STRUC", precision=6, scale=3)
    private Double dateStructure;

SQL Type in DB is NUMBER(6,3)

Hibernate validation fails with:

 org.hibernate.HibernateException: Wrong column type in S3.DECOM for column DATE_STRUC. Found: number, expected: double precision
	at org.hibernate.mapping.Table.validateColumns(Table.java:284) [hibernate-core-3.5.0-Beta-2.jar:3.5.0-Beta-2]
	at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1156) [hibernate-core-3.5.0-Beta-2.jar:3.5.0-Beta-2]
	at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139) [hibernate-core-3.5.0-Beta-2.jar:3.5.0-Beta-2]
	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:364) [hibernate-core-3.5.0-Beta-2.jar:3.5.0-Beta-2]
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1367) [hibernate-core-3.5.0-Beta-2.jar:3.5.0-Beta-2]
	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:858) [hibernate-annotations-3.5.0-Beta-2.jar:3.5.0-Beta-2]
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:733) [hibernate-entitymanager-3.5.0-Beta-2.jar:3.5.0-Beta-2]

> SchemaValidator mapping of double to SQL-Type DECIMAL with Precision and Scale
> ------------------------------------------------------------------------------
>
>                 Key: HHH-1008
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1008
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.1 beta 2
>         Environment: DB2, Win2k
>            Reporter: Phritz Grau
>            Assignee: Diego Plentz
>            Priority: Minor
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> I am using the new SchemaValidator, it really is very useful. 1000x thanks.
> However we have one problem.
> Our tables contain a lot columns of SQL-Type DECIMAL with precision and scale.
> These are mapped to double or java.lang.Double and
> we specify the mapping like e.g.:
>         <property
>             name="doubleVal"
>             type="double">
>             <column name="dVal" precision="12" scale="6"/>
>         </property>
> Using the SchemaValidator results in an error:
> org.hibernate.HibernateException: Wrong column type: dVal, expected: double
> 	at org.hibernate.mapping.Table.validateColumns(Table.java:205)
> 	at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:938)
> Since there is not appropriate java type for sql type decimal,
> it would be very nice if the above error is omittet,
> when the mapping contains the correct precision and scale
> values.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list