facebook

Hibernate Reverse-Engineering – How to exclude tables?

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #270118 Reply

    I am using 5.1.0 GA and 5.5M2 releases.

    MyEclipse reverse-eng wizard does not filter out tables specified in “hibernate.reveng.xml” . Any idea how to make it work.

    I want to exclude certain tables during Hibernate Reverse Engineering process. I have created “hibernate.reveng.xml” file. I provide location of this file to the reverse-eng wizard. This file contains following lines:

    <hibernate-reverse-engineering>
    <table-filter match-schema=”.*” match-name=”ERR$.*” exclude=”true”/>
    </hibernate-reverse-engineering>

    For testing purpose I added following lines to “hibernate.reveng.xml”
    <type-mapping>
    <sql-type jdbc-type=”NUMERIC” precision=’1′ hibernate-type=”boolean” />
    </type-mapping>

    MyEclipse reverse-eng wizard does show these values in “customized type mapping” table. It means the wizard does read the “hibernate.reveng.xml” file.

    Do I need to specify “Custom rev-eng strategy”? Is it optional. Currently I am not specifying it.

    #270157 Reply

    Brian Fernandes
    Moderator

    Hi,

    MyEclipse ignores the table-filter element in the reverse engineering settings files.

    You must select all the tables you wish to reverse engineer in the DB Browser view prior to invoking the Reverse engineering tool. Only tables selected will be reverse engineered.

    The RE tool will create references to other tables the selected table(s) is related to, even if you have not selected them. In case this is not the desired behavior, on page 3 of the RE wizard, uncheck the last two checkboxes.

    The RE strategy is not required.

    Hope this helps, do let us know if you require further assistance.

    #270178 Reply

    Thank you for reply. I am using a work around by extending “DelegatingReverseEngineeringStrategy” class from Hibernate Tools. It is working and does filter tables that I dont want. off course these tables are stand alone tables and are not being referenced by other tables.

      An other question- I want to change pojo creation template to create pojos with Set<xxx> instead of Set only

    The pojo that RE wizard generates, contains SET for the associated pojos. I want to modify this behavior so that I parameterize it like Set<Child>. I option I understand is writing a template or modifying an existing one that comes with Hibernate Tools. But which template I should change. Is there any other workaround.

    I want to do this due to the xFire. xFire complains about the auto generated pojos and is not able to create SCHEMA and WSDL from them. I fixed the problem by modifying the pojos and parameterizing the associated collection. Doing this after every RE for 100 tables is very time consumings.

    Can you please recommend any solution?

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Hibernate Reverse-Engineering – How to exclude tables?

You must be logged in to post in the forum log in