-->
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: ReverseEng: Package ignored if class name specified
PostPosted: Mon Jun 19, 2006 1:20 pm 
Newbie

Joined: Mon Oct 17, 2005 11:56 am
Posts: 16
Location: Arlington, VA
Tool versions:
JDK 1.5.0_04
Hiberate Tools 3.1.0beta5
Eclipse 3.1.2

I'm using Hibernate Tools to reverse engineer tables into hbm and java files. When I specify a class name for a table in reveng.xml, the generated HBM and Java files end up in the base directory instead of in the package specified. I've tried specifying the package in the <table-filter> and in the tools reverse engineering run config. Here's a reduced version of the 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-name="SEC_.*" 
                 package="com.teoco.common.security.model" />
   <table name="SEC_ROLE" ></table>
   <table name="SEC_USERS" class="User"></table>
</hibernate-reverse-engineering>


Running the hibernate code generation on this file sends the "User" files to the default package (no package) while the SecRole files are sent to the specified package. Generated files excerpts: [imports removed below]

Code:
// default package
// Generated Jun 19, 2006 1:15:42 PM by Hibernate Tools 3.1.0.beta5

/**
* User generated by hbm2java
*/
public class User implements java.io.Serializable {


and

Code:
package com.teoco.common.security.model;

// Generated Jun 19, 2006 1:15:42 PM by Hibernate Tools 3.1.0.beta5

/**
* SecRole generated by hbm2java
*/
public class SecRole implements java.io.Serializable {



Any suggestions? Is this known? Didn't find it in the forum.

Thanks,
Vick


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 4:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
put it in jira - we should allow the package to be appended to the classname if it does not contain a dot.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Specifying fully-qualified class name in table element works
PostPosted: Tue Jun 20, 2006 9:18 am 
Newbie

Joined: Mon Oct 17, 2005 11:56 am
Posts: 16
Location: Arlington, VA
Instead of attempting to specify a package in the table element filter, plus a class name in the table element, I just specified the fully-qualified class name in the table element "class" property. That does exactly what I need.

Thanks Max!


Top
 Profile  
 
 Post subject: Put it in JIRA - # HBX-691
PostPosted: Tue Jun 20, 2006 11:20 am 
Newbie

Joined: Mon Oct 17, 2005 11:56 am
Posts: 16
Location: Arlington, VA
I put it in as an improvement to Tools. Assigned # HBX-691. Thanks again.


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.