-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Package not being followed by hibTools3.1.0beta3 code gen
PostPosted: Sun Jan 29, 2006 6:14 am 
Beginner
Beginner

Joined: Fri Jan 27, 2006 4:20 am
Posts: 22
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.1

MySQL 5.0.9

hibernate.reveng.xml

Code:
<?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.xml

Code:
<?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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 29, 2006 8:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try to use org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy to see if it changes things.

And there is nothing commented out, it is just a comment that it has generated in to the default package.

otherwise try the nightly build.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 29, 2006 12:34 pm 
Beginner
Beginner

Joined: Fri Jan 27, 2006 4:20 am
Posts: 22
Wow that's a direct hit man! Thanks, it worked! How did you learned that? Im having difficulty on getting some detailed referrence on using hibernate tools.

Anyways, yeah you're right, i just mis-looked it as it was declared as package default; though it is incorrect syntax and grammar in java.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 29, 2006 12:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Maybe I learned it while I wrote Hibernate Tools ;) (but otherwise it has been written more than a few times before, so some searching might have helped you)

anyway, requirement of specifying a reveng startegy is a bug in the current release.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.