Hi,
Im wondering why the code generation tool provided by Hibernate Tools 3.1.0 Beta 3 is not following the package I specified on "Hibernate Code Generation..." dialog box on the prompt "Package:". I tried to specify one, but it always generates DAO on a default package. I even tried to cheat by specifying the output directory to the package I specified but still it generates a default package statement on DAOs. I also wondering why the package statements that it generates is commented out.
Code:
// default package
// Generated Jan 29, 2006 6:09:17 PM by Hibernate Tools 3.1.0 beta3
import java.util.HashSet;
import java.util.Set;
..
..
..
Does anyone know if im doing something wrong? Is it a bug? (though probably not cause it does not occur on Hibernate Tools 3.1.0 Beta 2) I tried searching through the forum but no luck. Thanks.
Also, is there a way that I could tell the tool that instead of generating a new hibernate.cfg.xml, modify my existing one?
Hibernate 3.1.1 Eclipse 3.1.1MySQL 5.0.9hibernate.reveng.xmlCode:
<?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-catalog="demo2" match-name="users"/>
<table-filter match-catalog="demo2" match-name="roles"/>
<table-filter match-catalog="demo2" match-name="user_role"/>
<table-filter match-catalog="demo2" match-name="user_data"/>
</hibernate-reverse-engineering>
Generated hibernate.cfg.xmlCode:
<?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 name="HibernateSessionFactory">
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/demo2</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.myeclipse.connection.profile">localhost mysql</property>
<mapping resource="UserData.hbm.xml" />
<mapping resource="UserRole.hbm.xml" />
<mapping resource="Roles.hbm.xml" />
<mapping resource="Users.hbm.xml" />
</session-factory>
</hibernate-configuration>
using code gen from
Code:
org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy