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

Jim Elliott (JIRA) noreply at atlassian.com
Tue Jul 3 16:20:52 EDT 2007


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

Jim Elliott commented on HBX-945:
---------------------------------

Sorry, I retract my report. It turned out to be a coincidence that was unrelated to the use of the maven tasks. My build process was broken, and needed to ensure that the UserType implementations were compiled before running the codegen task.

Everything is working fine as far as I can tell; I've retracted my vote; if you are able to delete my useless uploaded "test case" to save space, please feel free to do so.

> 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
>
>         Attachments: TestCase.zip
>
>
> 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