[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-440) hbm2java does not generate correct POJO property types for UserType columns
Brill Pappin (JIRA)
noreply at atlassian.com
Mon May 28 00:15:04 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27060 ]
Brill Pappin commented on HBX-440:
----------------------------------
This doesn't appear to be fixed, I still have the issue.
Whats stragne is that generation was working last time I ran it, I added a new UserType and not all pojo members of a particular type are set as the hibernate type not the class they should be.
I'm using hibernate-3.2.1-ga
> hbm2java does not generate correct POJO property types for UserType columns
> ---------------------------------------------------------------------------
>
> Key: HBX-440
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-440
> Project: Hibernate Tools
> Issue Type: Bug
> Components: hbm2java
> Affects Versions: 3.1alpha5
> Environment: Pulled from CVS somewhere between 3.1a5 and 3.1b1
> Reporter: James Schopp
> 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