tags:

views:

148

answers:

1

Hello:

I need to access from Grails to several different tables that are in different schemas. The user has access permissions to all the tables, but , when I try to map the Domain classses to the tables, I can't find a way to get it done.

I've tried to map the domain this way:

  static mapping = {
        table 'SCHEMA2.TABLE'
        //Table columns and mapping
        ...
    }

I can also change the default schema on the DataSource file, but in this case I keep accessing only one of the two schemas

  hibernate.default_schema = 'schema2'

We've make alias to acess the tables in schema2 from schema1, but I think there should be a way to do this, without having to define all the mapping with Hibernate (I really don't like XML files)

A: 

Have you seen the DataSources plugin? I believe it does what you are looking for - allows to configure multiple dbs and map domain objects to different databases.

I thought I saw some emails on the forum about 1.2 not working right now - definitely read through the forums to learn about issues other people may have .

Jean Barmash