On Mar 20, 2007, at 9:47 AM, Chris Lamey wrote:
I use Postgres with Abator and don't have the db name in the
$TABLE_SqlMap.xml file names. Here's what one of my table elements
looks like:
<table schema="" tableName="SUGGESTION"
domainObjectName="Suggestion">
<property name="useActualColumnNames" value="false"/>
</table>
I used the wrong term in my email. The generated files include the
schema name, not the database name. I see in your table elements that
you set the schema to "". I can't do that since my databases are in a
named schema. For now I've solved the problem by doing the following
in my Ant build file after abator runs. &schema; is an XML entity
reference whose value is the name of my schema.
<move todir="gen/sqlmaps">
<fileset dir="gen/sqlmaps">
<include name="*_SqlMap.xml"/>
</fileset>
<mapper type="glob" from="&schema;_*" to="*"/>
</move>
The schema is then specified on the JDBC URL
(connectionURL="jdbc:postgresql://localhost/suggestions"), like Jeff
said.
Postgres has a notion of a "search path" that is a list of schemas
that are searched to find databases.
I think I need to add my schema to the search path, but I don't know
how to do that.
Any ideas?
Cheers,
Chris
On Tue, 2007-03-20 at 07:17 -0500, Jeff Butler wrote:
Abator only uses the catalog and schema in the file names if you
specify them in your configuration. I don't know Postgres, but with
SQL Server you can leave the catalog out of the <table> configuration
elements and specify the default database name on the connection URL.
Jeff Butler
On 3/19/07, Mark Volkmann <[EMAIL PROTECTED]> wrote:
When I run Abator against a MySQL database I get files with
names
like {table-name}_SqlMap.xml.
When I run against Postgres or SQL Server I get files with
names like
{database_name}_{table-name}_SqlMap.xml.
Is there anything I can do to get Abator to not add the
database name
prefix for Postgres and SQL Server so I don't have to change
my code
when the database type changes?