Re: DB_NAME toMany expressions

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Dec 30 2005 - 10:30:59 EST

  • Next message: Andrus Adamchik: "Re: No access to getObjectStore().getFlattenedInserts() / getFlattenedDeletes()"

    Cris,

    Most of the "access.trans" package is from the good old days when we
    were not ready to generalize well about all possible scenarios, so it
    has plenty of if/else special cases. Some of them may have handled
    old limitations that are no longer true. If you can provide a patch
    and a test case showing how this works with multi-pk relationships,
    I'll be glad to apply it.

    Andrus

    On Dec 19, 2005, at 8:12 PM, Cris Daniluk wrote:

    > I'm trying to understand the nature of this limitation in
    > QueryAssemblerHelper:
    >
    > if (pk.size() != 1) {
    > StringBuffer msg = new StringBuffer();
    > msg
    > .append("DB_NAME expressions can only support ")
    > .append("targets with a single column PK. ")
    > .append("This entity has ")
    > .append(pk.size())
    > .append(" columns in primary key.");
    >
    > throw new CayenneRuntimeException(msg.toString());
    > }
    >
    > I have a flattened relationship to a destination table that is just 2
    > PKs - a group id and a role name. I'm not able to use expressions on
    > it due to the check above, but I don't entirely understand why it is
    > necessary. It looks like the query syntax produced if this check is
    > removed is accurate.
    >
    > Cris
    >



    This archive was generated by hypermail 2.0.0 : Fri Dec 30 2005 - 10:31:07 EST