]
Max Rydahl Andersen commented on HBX-440:
-----------------------------------------
I can't reproduce this so you will have to open a new issue with a testcase proving
it.
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: