You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Ray Malanga <ra...@purejavasolutions.com> on 2006/07/23 02:30:06 UTC

Is there a way to get schema and catalog into the XML file?

Hi.  I'm having a problem similar to the recent post by 
"Ajay.Bh...@us.hsbc.com".

Is there a way to get DDLUtils to include the schema and catalog of a 
table in the XML file?
For example, the XML generated by DDLUtils for my database may currently 
look like this:

  <database name="SomeDatabase">
    <table name="SomeTable">
...
    </table>
</database>

What I really need is this:

  <database name="SomeDatabase">
    <table name="SomeTable" catalog="SomeCatalog" schema="SomeSchema">
...
    </table>
</database>

Perhaps it may help if I give a little background about my situation...
I use the DDLUtils ant task to dump each database required by my web 
app.  I few XSLT and Velocity transformations later I have a completely 
functional data access layer written in Java that I didn't have to write 
:).  Now I have the problem where two different catalogs have a table 
with the same name (but not the same structure) and I'd like to modify 
my templates to carry the catalog and schema name along but I'd need 
DDLUtils output to have it in there first.


ty,

- Ray M

Re: Is there a way to get schema and catalog into the XML file?

Posted by Jun Li <al...@gmail.com>.
Sure you can.

Just need to add two more mappings:
 <attribute name="catalog" property="catalog"/>

<attribute name="schema" property="schema"/>
Edit mapping.xml to include the above lines under

<class name="org.apache.ddlutils.model.Table">

On 7/23/06, Ray Malanga <ra...@purejavasolutions.com> wrote:
>
> Hi.  I'm having a problem similar to the recent post by
> "Ajay.Bh...@us.hsbc.com".
>
> Is there a way to get DDLUtils to include the schema and catalog of a
> table in the XML file?
> For example, the XML generated by DDLUtils for my database may currently
> look like this:
>
> <database name="SomeDatabase">
>    <table name="SomeTable">
> ...
>    </table>
> </database>
>
> What I really need is this:
>
> <database name="SomeDatabase">
>    <table name="SomeTable" catalog="SomeCatalog" schema="SomeSchema">
> ...
>    </table>
> </database>
>
> Perhaps it may help if I give a little background about my situation...
> I use the DDLUtils ant task to dump each database required by my web
> app.  I few XSLT and Velocity transformations later I have a completely
> functional data access layer written in Java that I didn't have to write
> :).  Now I have the problem where two different catalogs have a table
> with the same name (but not the same structure) and I'd like to modify
> my templates to carry the catalog and schema name along but I'd need
> DDLUtils output to have it in there first.
>
>
> ty,
>
> - Ray M
>



-- 
--------------
Cheers,
Jun

Re: Is there a way to get schema and catalog into the XML file?

Posted by Thomas Dudziak <to...@gmail.com>.
On 7/22/06, Ray Malanga <ra...@purejavasolutions.com> wrote:

> Is there a way to get DDLUtils to include the schema and catalog of a
> table in the XML file?

This is planned as one of the first things for the 1.1 release:

http://issues.apache.org/jira/browse/DDLUTILS-116

Once the 1.0 is out of the door (which means fixes for the remaining
bugs assigned to 1.0), the XML schema and this will be high on the
list.

Tom