[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-945) CLONE -hbm2java does not generate correct POJO property types for UserType columns

Brill Pappin (JIRA) noreply at atlassian.com
Mon May 28 00:37:04 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27061 ] 

Brill Pappin commented on HBX-945:
----------------------------------

This *IS* fixed as indicated but is back in version 3.2.1.ga.
Someone should update the Affects Version/s to 3.2.1.ga.

How did this manage to regress so far back?
Was a unit test missed?


> CLONE -hbm2java does not generate correct POJO property types for UserType columns
> ----------------------------------------------------------------------------------
>
>                 Key: HBX-945
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-945
>             Project: Hibernate Tools
>          Issue Type: Bug
>          Components: hbm2java
>    Affects Versions: 3.1alpha5
>         Environment: Pulled from CVS somewhere between 3.1a5 and 3.1b1
>            Reporter: Brill Pappin
>             Fix For: 3.1beta2
>
>
> I have defined my own custom UserType (which coincidentally maps a DB2 decimal field to a java.sql.Date property, using some special formatting...).
> My mapping file contains:
>         <property name="connectDate" type="DecimalDateType">
>             <column name="UMPCN" precision="8" scale="0" not-null="true" />
>         </property>
> where DecimalDateType is the fully-qualified name of my UserType class.
> The POJO generated contains the property:
>         private DecimalDateType connectDate;
> This is incorrect. It SHOULD have generated a property of the type returned by DecimalDateType.returnedClass() (which in this case is java.sql.Date.class). ie. It should have been
>         private java.sql.Date connectDate;
> The "decision" of which type to generate (ie where the error manifests itself) error appears to be in
>         Cfg2JavaTool.java
> in the method
>         private String getJavaTypeName(Value value, boolean preferRawTypeNames) 
> I am not sure of the exact fix, since there appear to be other checks being done, and I do not understand all the logic here.
> Thanks! 
> james

-- 
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