Re: [appfuse-user] How to specify default schema/owner for SchemaExportTask

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [appfuse-user] How to specify default schema/owner for SchemaExportTask

Matt Raible-3
If you're using AppFuse 1.8+, you could customize how the
database.properties file is generated and what user/pass are used in
it.  This is what's at the bottom of properties.xml - just change how
the username and password entries are generated.

<macrodef name="generate-database-properties">
        <sequential>
            <echo>generating database.properties from build.properties</echo>
            <propertyfile comment="Hibernate Configuration for JUnit tests"
                file="${basedir}/database.properties">
                <entry key="hibernate.dialect" value="${hibernate.dialect}"/>
                <entry key="hibernate.connection.driver_class"
value="${database.driver_class}"/>
                <entry key="hibernate.connection.url" value="${database.url}"/>
                <entry key="hibernate.connection.username"
value="${database.username}"/>
                <entry key="hibernate.connection.password"
value="${database.password}"/>
                <entry key="hibernate.connection.show_sql"
value="${database.show_sql}"/>
                <entry key="dao.type" value="${dao.type}"/>
             </propertyfile>
             <replace file="database.properties" token="amp;" value=""/>
             <property file="database.properties"/>
         </sequential>
    </macrodef>

Matt

On 6/29/05, Wang, George <[hidden email]> wrote:

> Our db-prepare target uses SchemaExportTask to create the database
> tables and export the sql script.  It uses the schema based on the user
> of the connection, eg "test.app_user" if we use test/test for the
> connection.
>
> I wanted to create "dbo.app_user" table instead of "test.app_user".
> Using xdoclet @hibernate.class table="dbo.app_user" works (but seems
> redundant if I got 10 tables).  Shouldn't be a better way of doing this?
> It did not seem to work when I put a property of
> hibernate.default_schema=dbo for SchemaExportTask.
>
> Thanks,
> -George
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...