FAQ
Hi,

I have a project that uses DB2 tables that I don't have control
over. The problem is that for a specific database entity, I need
to handle records from three different DB2 libraries:

- LIB1.TABLE
- LIB2.TABLE
- LIB3.TABLE

Before, I simply created a view that contained a union of those
three tables but now I need to write to it. When I try to create
those three tables in the modeler, it does not like to create

DBEntity Configuration
Name: TABLE
Schema: LIB1

+

DBEntity Configuration
Name: TABLE
Schema: LIB2

Why does this limitation exist? Is there a way around? I really
need to write to those tables depending on the logged-in user.

Any help appreciated,
Andreas Pardeike

Search Discussions

  • Michael Gentry at Nov 20, 2008 at 10:58 pm
    Have you tried having 3 DataMaps? You could put each in a separate
    DataMap and I think that would be OK. You'd also need 3 distinct Java
    classes (one for each). Cayenne would want this, anyway, so that it
    would know how to route reads/inserts/updates.

    On Thu, Nov 20, 2008 at 4:16 AM, Andreas Pardeike wrote:
    Hi,

    I have a project that uses DB2 tables that I don't have control
    over. The problem is that for a specific database entity, I need
    to handle records from three different DB2 libraries:

    - LIB1.TABLE
    - LIB2.TABLE
    - LIB3.TABLE

    Before, I simply created a view that contained a union of those
    three tables but now I need to write to it. When I try to create
    those three tables in the modeler, it does not like to create

    DBEntity Configuration
    Name: TABLE
    Schema: LIB1

    +

    DBEntity Configuration
    Name: TABLE
    Schema: LIB2

    Why does this limitation exist? Is there a way around? I really
    need to write to those tables depending on the logged-in user.

    Any help appreciated,
    Andreas Pardeike
  • Andreas Pardeike at Nov 21, 2008 at 9:25 am

    On 20 nov 2008, at 23.58, Michael Gentry wrote:

    Have you tried having 3 DataMaps? You could put each in a separate
    DataMap and I think that would be OK. You'd also need 3 distinct Java
    classes (one for each). Cayenne would want this, anyway, so that it
    would know how to route reads/inserts/updates.
    I tried multiple datamaps and the modeler still complains. The field
    with
    the duplicate table name is red and does not save.

    The following does not work and I have no clue why:

    - DefaultDomain

    +- domain1_map1
    +- DbEntity: SCHEME1.TEST
    +- domain1_map2
    +- DbEntity: SCHEME2.TEST


    /Andreas
  • Andrus Adamchik at Nov 21, 2008 at 11:45 am
    This is a current limitation. Cayenne should really be looking at the
    fully qualified name of the table, including the schema, but in some
    places it doesn't. A workaround would be to enter a fully qualified
    name as DbEntity "name", and don't enter anything in the schema field.

    Andrus

    On Nov 21, 2008, at 11:23 AM, Andreas Pardeike wrote:
    On 20 nov 2008, at 23.58, Michael Gentry wrote:

    Have you tried having 3 DataMaps? You could put each in a separate
    DataMap and I think that would be OK. You'd also need 3 distinct
    Java
    classes (one for each). Cayenne would want this, anyway, so that it
    would know how to route reads/inserts/updates.
    I tried multiple datamaps and the modeler still complains. The field
    with
    the duplicate table name is red and does not save.

    The following does not work and I have no clue why:

    - DefaultDomain

    +- domain1_map1
    +- DbEntity: SCHEME1.TEST
    +- domain1_map2
    +- DbEntity: SCHEME2.TEST


    /Andreas

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 20, '08 at 9:19a
activeNov 21, '08 at 11:45a
posts4
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2021 Grokbase