You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Roy Alan Hardin <ro...@hardin.de> on 2003/05/11 23:38:09 UTC

How to specify schema of the indirection-table (repository.xml)?

Hello,

in the Advanced O/R Tutorial ( http://db.apache.org/ojb/tutorial3.html ) you
can read how to configure OJB to do m:n mapping transparently, thus there is
no need for an association class on the OOD level. Among other things it is
necessary to create and specify an intermediary table in the attribute
"indirection-table" of the element "collection-descriptor". 
 
     ...
  
     <collection-descriptor 
         name="projects"
         element-class-ref="not.important.Class"
         auto-retrieve="true"
         auto-update="true"
         indirection-table="navigation_category">
            <fk-pointing-to-this-class column="notimportant"/>
           <fk-pointing-to-element-class column="notimportant"/>
     </collection-descriptor>

     ...

I use a PostgreSQL 7.3 database system. If I create an intermediary table
named "navigation_category" in the "public" schema, everything will work
fine. 

But if I create the intermediary_table in my own "navigation" schema - where
all the other user tables reside -  then OJB will throw an SQL Exception
"Relation navigation_category does'nt exist". 

It seems that there is no attribute or element to specify the schema of the
indirection-table. So I tried to specify the schema within the value of
attribute "indirection-table" ( ...
indirection-table="navigation.navigation_category" ...) but the OJB parser
threw an exception due to syntactical reasons. 

Any ideas how to specify the "indirection-table-schema"? 

Thanks a lot in advance,

Roy