-
1. Re: Hibernate Code Generation
maxandersen Jan 6, 2009 9:19 AM (in response to kvudaykumar)if it opened a reveng.xml file it must have been generated with some content. What is in it ? It maybe be the one preventing the generation ?
-
2. Re: Hibernate Code Generation
kvudaykumar Jan 6, 2009 9:34 AM (in response to kvudaykumar)Thanks for the quick response
pasting the hibernate.reveng.xml content generated :
Is there any place where I can find the log / is there any window where need to check for the logs to proceed?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<type-mapping>
<sql-type jdbc-type="VARCHAR" hibernate-type="string"
length="50" not-null="true">
</sql-type>
<sql-type jdbc-type="INTEGER" hibernate-type="int"
not-null="true">
</sql-type>
<sql-type jdbc-type="VARCHAR" hibernate-type="string"
length="250" not-null="true">
</sql-type>
<sql-type jdbc-type="VARCHAR" hibernate-type="string"
length="100" not-null="true">
</sql-type>
</type-mapping>
<table-filter match-schema="struts-hibernate" match-name=".*" />
<primary-key></primary-key>
<column name="shortdesc" jdbc-type=''>
<column name="longdesc" jdbc-type=''>
<column name="pageurl" jdbc-type=''>
</hibernate-reverse-engineering> -
3. Re: Hibernate Code Generation
msorokin Jan 6, 2009 10:48 AM (in response to kvudaykumar)I've just created a java project with hibernate , connected to MySQL and generated the files using reverse engineering quite successfully.
This is my .reveng.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<table-filter match-name="table-name" match-catalog="database"></table-filter>
</hibernate-reverse-engineering>
I think you need to click the "Table Filters" view and there select the table you want to work with.
I guess you used "Type Mappings" to generate your reveng.xml file
I also recommend you to watch our demo video that shows how you can generated those files.
http://docs.jboss.org/tools/movies/demos/Reverse_engineering_and_code_generation/Reverse_engineering_and_code_generation.htm -
4. Re: Hibernate Code Generation
maxandersen Jan 6, 2009 11:32 AM (in response to kvudaykumar)that reveng.xml looks incomplete - the xml is not balanced.
Did you intentionally create that file ? I would suggest removing it just to see if it works fine without and then after that start filtering it. -
5. Re: Hibernate Code Generation
kvudaykumar Jan 7, 2009 7:30 AM (in response to kvudaykumar)I generated the code successfully.
reveng.xml was generated automatically only. When code generation was not working then I tried different options and finally I got the xml content.
Thanks a lot especially for the demo.