Hi guys,

You can now do the following in the hibernate tools (only programmatically at the moment - ant and ui is on its way):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd"; >


<hibernate-reverse-engineering>

<type-mapping>
<sql-type jdbc-type="VARCHAR" length='20' hibernate-type="SomeUserType" />
<sql-type jdbc-type="VARCHAR" length='1' hibernate-type="yes_no" />
<sql-type jdbc-type="BINARY" length='1' hibernate-type="boolean" />
</type-mapping>


<table-filter match-catalog=".*" match-schema=".*" match-name="BIN$.*" exclude="true"/>
<table-filter match-name="DEFUNCT_TABLE" exclude="true" />
<table-filter match-catalog="BAD" match-schema="SCHEMA" match-name=".*" exclude="true" />

</hibernate-reverse-engineering>


This allows for our rev.eng. users to define very efficiently what part of the database they want to have
reverse engineered (please note that this is much better than what middlegen does since we support multiple
schema/catalog and we don't require users to list all their tables when they just need to change some minor "cross-cutting" things
like the exclude thing)


After I have added ui/ant support for the above (should be pretty trivial), I'll add the next step "overrides of specific table/colum/foreignkey" stuff:

        <table name="CUSTOMER" package="org.funk" class-name="MyCustomer">
                <column name="order" property-name="orderName" />
                <column name="flag" hibernate-type="boolean" />
                <column name="dbonlycol" exclude="true" />
        </table>

The above will simply say that a table in the default catalog/schema named CUSTOMER will be called org.funk.MyCustomer and
its column named order will be named ordernName, flag will be a boolean no matter what other mechanisms says and the dbonlycol will not
be mapped. Long sentence but I hope you get the big picture - note that if any other column exists in the CUSTOMER table it
will be mapped - meaning you only specify what is not the default in this reveng file - and I will apply the same mechanics to the UI.


Hope you like it ;)

--
--
Max Rydahl Andersen
callto://max.rydahl.andersen

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]
http://jboss.com


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to