Client PK access

From: Kevin Menard (kmenar..ervprise.com)
Date: Sun Apr 27 2008 - 10:08:08 EDT

  • Next message: Andrus Adamchik: "Re: Client PK access"

    As part of the fix for CAY-574, we added a getPrimaryKeyNames() :
    Collection<String> method to ObjEntity. This did the trick and allowed
    DataObjectUtils to work. Unfortunately, it doesn't expose the PK type
    information.

    As some of you likely know, I'm working on Tapestry5-Cayenne integration
    module with Robert Zeigler. I'm trying to ensure the module works just as
    well for an ROP client as it does for traditional Cayenne server apps. One
    of the things we need to be able to handle is the coercion of keys to and
    from String values. This implies knowledge of the key class type, which is
    currently unavailable in the client.

    I'm soliciting ideas on how to improve this. Off the top of my head, I'm
    thinking something like the following:

    // Simple key-> value lookup.
    String getPkClassName(String pkName)

    // Modification of existing method to allow PK lookups.
    ObjAttribute getAttribute(String name, boolean includePks)

    // Rather than just have getPrimaryKeyNames(), return a mapping
    // of the key name and its Java class.
    Map<String, String> getPrimaryKeys()

    If possible, this is something I'd like to see squeezed in for 3.0M4,
    because I'd really like that module to not have to rely on 3.0-SNAPSHOT.

    Thanks,
    Kevin



    This archive was generated by hypermail 2.0.0 : Sun Apr 27 2008 - 10:08:42 EDT