Multiple database strangeness

From: Michal Kozlowski (mkozlowsk..MVProjects.com)
Date: Thu Oct 14 2004 - 11:36:25 EDT

  • Next message: Bryan Lewis: "exception in ContextCommit"

    Hi,
    Awesome product, and I'm new to this so I might be doing something wrong. I have 2 databases that I'm trying to access using cayenne and I'm having some difficulty. One database has all the information (proprietary to a product we use), and our own database that has some more information as well as additional relationships between the data, simple example below and the source of my problem.

    DB A DB B

    _ProjectInfo ProjectEngineer
    _UserInfo

    Inside DB B ProjectEngineer is a table with 2 fields ProjectId and ProjectEngineerId(UserId), as the name states it defines a ProjectEngineer for a Project. Now in Cayenne I have a DBEntity _ProjectInfo, _UserInfo, as well as Project, User DBObjects in one DataMap. In another DataMap I have DBEntity ProjectEngineer, no DBObjects for this relationship. I want to be able to go Project.getProjectEngineer() returning me the user or vice versa User.getProjects() returning me the Projects.

    When I do this cayenne creates a wrong select statement assuming the ProjectEngineer table is in DB A which it isn't.

    SELECT DISTINCT t0.Disabled, t0.FirstName, t0.LastName, t0.LoginName, t0.UserId FROM dbo._UserInfo t0, dbo.ProjectEngineer t1 WHERE t0.UserId = t1.ProjectEngineerId AND (t1.ProjectId = ?) [bind: 211]

    Attached is my cayenne.xml files as well as driver and map files.

    I hope I'm understanding cayenne properly and I'm not doing something completely wrong, additional info is this is running as a tapestry app.
    Thanks for the awesome app.

    Cheers
    Michal Kozlowski

    Developer/Database Administrator
    IMV Projects Inc.
    (403) 770-7552

    It is a painful thing
    To look at your own trouble and know
    That you yourself and no one else has made it
      - Sophocles, Ajax













    This archive was generated by hypermail 2.0.0 : Thu Oct 14 2004 - 11:37:53 EDT