Fwd: DB_NAME toMany expressions

From: Cris Daniluk (cris.danilu..mail.com)
Date: Mon Dec 19 2005 - 12:12:59 EST

  • Next message: Mike Kienenberger: "Setting a relationship to a generic DataObject in order to log the primary key value"

    Oops. Reforwarding to user list.

    ---------- Forwarded message ----------
    From: Cris Daniluk <cris.danilu..mail.com>
    Date: Dec 19, 2005 12:12 PM
    Subject: DB_NAME toMany expressions
    To: cayenne-deve..bjectstyle.org

    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 : Mon Dec 19 2005 - 12:13:01 EST