[
http://opensource.atlassian.com/projects/hibernate/browse/HBX-970?page=co...
]
Florian F commented on HBX-970:
-------------------------------
I have the same issue.
I wonder if many people would actually use a constructor with over 100 parameters.
I would go further: Hibernate should not generate the full constructor with more than 255
fields, as it seems to be invalid in Java.
POJO generation should have full contructor as an option
--------------------------------------------------------
Key: HBX-970
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-970
Project: Hibernate Tools
Issue Type: Bug
Components: hbm2java, reverse-engineer
Affects Versions: 3.2beta9
Environment: Hibernate3, Oracle 10g
Reporter: Alberto A. Flores
When using hbm2java (for reverse engineering the database to generate POJOs), there is no
real way to declare full constructor generation as an option (which is not required in
Hibernate anyway). In a large table, I found the error of "can't create a
constructor with more than 255 parameters" (which could easily grow if you use
inheritance). We had to fix the PojoContructors.ftl code to never generate that full
contructor.
Potential fixes:
- Find a way to initialize the BasicPojoClass to initialize the needFullContructor using
<property> in the hbm2java
- Using the <property> feature within hbm2java, fix the PojoConstructor.ftl to
check for a variable that is (optionally) visible by virtue of the <property> tag
instead of always checking for "pojo.needFullConstructor"
- Provide a way to replace BasicPojoClass as part of the hbm2java task. By default, this
uses the hardcoded code to always use this template.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira