Re: newbie questions to well inderstand cayenne framework.

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Dec 02 2005 - 03:40:44 EST

  • Next message: Andrea Borgogelli Avveduti: "object regsitered in a different DataContext"

    Hi Olivier,

    I this is more of a cayenne-user list question, so I am forwarding it
    there....

    > 1) Is cayenne allow to create a relationship at object layer level,
    > that
    > link 2 colums of 2 different DBs ? if yes, where is stored this
    > relationship then ?

    Absolutely. I realized that we do not have any documentation on that,
    so I uploaded a full example to Wiki today:

    http://objectstyle.org/confluence/display/CAY/Multiple+Databases+Example

    This should get you started. Main limitation of cross-db
    relationships is that you can't build qualifiers across such
    relationships that would result in a cross-db join in a single query.
    However relationships themselves work just fine.

    > 2) Is a query can be modeled, and then have an object for it ? same
    > thing for stored prodecures ?

    Sure. As you may have noticed you can map three types of queries in
    the Modeler. "Object Select Query" maps to an object automatically.
    With "Raw SQL" and "Stored Procedure Query" it will be your
    responsibility to ensure that the result labels match DbEntity column
    names for an appropriate object to make it work.

    > 3) As Cayenne rely on JDBC, is then possible to link A DB
    > datasource and
    > a LDAP datasource at object level ?
    > I mean in DB i have tables to manage an application named
    > "Project", and
    > Project have users whose account are stored in LDAP.

    Cayenne architecture is data source agnostic, but it is true that
    Cayenne currently only provides JDBC connectivity. I started on an
    LDAP DataNode some time back, but it never took off as the customer
    at the time lost interest in this feature and there wasn't much
    demand in the community.

    So officially Cayenne doesn't yet support LDAP. Your options would be
    either access LDAP independently from Cayenne and "inject" related
    objects, or create a fake LDAP DataNode in the mapping and intercept
    all queries to this DataNode using new 1.2 query routing API,
    executing them on your own, and sending the result up the stack.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Dec 02 2005 - 03:40:52 EST