From: Vick F. (JIRA) <no...@at...> - 2006-06-20 14:08:34
|
Reverse Engineering from DB to Java: Package ignored if class name specified ---------------------------------------------------------------------------- Key: HBX-691 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-691 Project: Hibernate Tools Type: Improvement Components: reverse-engineer Versions: 3.1.beta5 Environment: Hibernate 3.0.5 JDK 5 Reporter: Vick Fisher Priority: Minor 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: ------------------------------------------------------------------------------ <?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] ------------------------------------------------------------------------------ // 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 { ------------------------------------------------------------------------------ versus this for the SecRole class: ------------------------------------------------------------------------------ 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 { ------------------------------------------------------------------------------ Max mentioned that the improvement might be to append package if there is no dot in the specified class name. -- 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.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |