[JIRA] Created: (CAY-574) DataObjectUtils 'objectForPK' should work on the client

From: Andrus Adamchik (JIRA) ("Andrus)
Date: Wed Jun 21 2006 - 05:06:49 EDT

  • Next message: Andrus Adamchik (JIRA): "[JIRA] Created: (CAY-575) Peer CayenneContexts on the remote client do not synchronize changes with each other - bug in ClientChannel"

    DataObjectUtils 'objectForPK' should work on the client
    --------------------------------------------------------

             Key: CAY-574
             URL: http://issues.apache.org/cayenne/browse/CAY-574
         Project: Cayenne
            Type: Improvement

      Components: Cayenne Core Library
        Versions: 1.2, AFTER 1.2
        Reporter: Andrus Adamchik
         Fix For: AFTER 1.2

    While DataObjectUtil.objectForPK takes ObjectContext as an argument, using it on the remote client is not possible. The following exceptions happen on various overloaded calls:

    1. This will require method signature change:

    DataObjectUtils.objectForPK( c1,new ObjectId("MtTable1", "TABLE1_ID", 1));

    java.lang.ClassCastException
            at org.objectstyle.cayenne.DataObjectUtils.objectForPK(DataObjectUtils.java:276)
            at org.objectstyle.cayenne.remote.ClientChannelEventsTst.testSyncSimpleProperty(ClientChannelEventsTst.java:93)
            
    2. This should issue a query instead of doing DbEntity lookup:

       DataObjectUtils.objectForPK(
                    c2,
                    ClientMtTable1.class,
                    1);

    org.objectstyle.cayenne.CayenneRuntimeException: [v..AYENNE_VERSION@ @CAYENNE_BUILD_DATE@] No DbEntity for ObjEntity: MtTable1
            at org.objectstyle.cayenne.DataObjectUtils.buildId(DataObjectUtils.java:352)
            at org.objectstyle.cayenne.DataObjectUtils.objectForPK(DataObjectUtils.java:167)

         

    -- 
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators:
       http://issues.apache.org/cayenne/secure/Administrators.jspa
    -
    For more information on JIRA, see:
       http://www.atlassian.com/software/jira
    



    This archive was generated by hypermail 2.0.0 : Wed Jun 21 2006 - 05:08:17 EDT