[Hibernate-JIRA] Closed: (HBX-422) HBM2Java generates Interfaces for table and column names.
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-422?page=all ]
Max Rydahl Andersen closed HBX-422:
-----------------------------------
Resolution: Won't Fix
doesn't do it properly
> HBM2Java generates Interfaces for table and column names.
> ---------------------------------------------------------
>
> Key: HBX-422
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-422
> Project: Hibernate Tools
> Type: Improvement
> Components: hbm2java
> Environment: hibernate tools 3.1 alpha 5
> Reporter: sergiu gordea
> Priority: Minor
> Attachments: patch.txt
>
>
> I updated the Hibernatetooltask and PojoExporter class in order to generate an Interface for each mapped class.
> The interface contains the table in whic the class is stored and the column names for each property.
> I created IPojo.vm velocity template for implementing it.
> I think this is an usefull feature, and it will be good practice to use this constants instead of hard coded column names
> when querying the database. In this way, any change in the database structure will be catched by java compiler instead of
> trowing an exception on runtime.
> I created a new configuration and I uncommented the testHbm2JavaConfiguration() method.
> I use as input a file from /test/input .. folder.
> Maybe the functionality can be reviewed and improved by one of the developers who knows better the core code and
> introduce it in the next realease. I'll be very happy to see it integrated.
> Maybe some documentation will be needed to be updated too.
> Best,
> Sergiu
--
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
18 years, 4 months
[Hibernate-JIRA] Created: (HBX-728) Patch for hbm2dao "No signature of method getJavaTypeName matches (java.lang.Object,java.lang.Boolean) "
by Jacob Bergoo (JIRA)
Patch for hbm2dao "No signature of method getJavaTypeName matches (java.lang.Object,java.lang.Boolean) "
--------------------------------------------------------------------------------------------------------
Key: HBX-728
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-728
Project: Hibernate Tools
Type: Patch
Components: reverse-engineer
Versions: 3.2beta6
Environment: Hibernate tools beta6, Eclipse 3.2, Ant 1.6.5, Windows XP, Hibernate 3.1
Reporter: Jacob Bergoo
This is the fix for this error message:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2dao (Generates a set of DAOs)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] An exception occurred while running exporter #2:hbm2dao (Generates a set of DAOs)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing template daohome.ftl
[hibernatetool] freemarker.template.TemplateModelException: No signature of method getJavaTypeName matches (java.lang.Object,java.lang.Boolean)
to fix this you need to edit your dao templates you are using to generate the code. For the method findById() you have a if statement
<#if clazz.identifierProperty>
simply change this one to:
<#if clazz.identifierProperty?has_content>
and it should work.
--
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
18 years, 4 months
[Hibernate-JIRA] Closed: (HBX-720) Annotation Configuration not used when generating code
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-720?page=all ]
Max Rydahl Andersen closed HBX-720:
-----------------------------------
Fix Version: 3.2beta8
Resolution: Fixed
stupid bug - incredible noone else reported it ...guess annotations guys don't like codegeneration ;)
> Annotation Configuration not used when generating code
> ------------------------------------------------------
>
> Key: HBX-720
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-720
> Project: Hibernate Tools
> Type: Bug
> Components: reverse-engineer
> Versions: 3.2beta6
> Reporter: Manuel Gentile
> Fix For: 3.2beta8
>
>
> I have the following annotation configuration
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-configuration PUBLIC
> "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
> <hibernate-configuration>
> <session-factory>
> <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
> <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost</property>
> <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
> <property name="hbm2ddl.auto">create</property>
>
> <mapping class="..."/>
> <mapping class="..."/>
> ...
> </session-factory>
> </hibernate-configuration>
> In Hibernate Console Configuration if i disable the enable annotation checkbox and I try to see the classes in the hibernate configurations section I obtaion the followinf error
> org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="..."/> (and i think this is right!!!)
> If i enable the enable annotation checkbox, I can see the classes and the configuration in the right way
> but when I try to run code generation I receive
> org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="..."/> (and i think this is NOT right!!!)
--
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
18 years, 4 months
[Hibernate-JIRA] Updated: (HBX-720) Annotation Configuration not used when generating code
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-720?page=all ]
Max Rydahl Andersen updated HBX-720:
------------------------------------
Summary: Annotation Configuration not used when generating code (was: Annotation Configuration Error)
> Annotation Configuration not used when generating code
> ------------------------------------------------------
>
> Key: HBX-720
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-720
> Project: Hibernate Tools
> Type: Bug
> Components: reverse-engineer
> Versions: 3.2beta6
> Reporter: Manuel Gentile
> Fix For: 3.2beta8
>
>
> I have the following annotation configuration
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-configuration PUBLIC
> "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
> <hibernate-configuration>
> <session-factory>
> <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
> <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost</property>
> <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
> <property name="hbm2ddl.auto">create</property>
>
> <mapping class="..."/>
> <mapping class="..."/>
> ...
> </session-factory>
> </hibernate-configuration>
> In Hibernate Console Configuration if i disable the enable annotation checkbox and I try to see the classes in the hibernate configurations section I obtaion the followinf error
> org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="..."/> (and i think this is right!!!)
> If i enable the enable annotation checkbox, I can see the classes and the configuration in the right way
> but when I try to run code generation I receive
> org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="..."/> (and i think this is NOT right!!!)
--
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
18 years, 4 months