Package org.apache.cayenne

Examples of org.apache.cayenne.DataObject.readPropertyDirectly()


                    "Expected DataObject, got: " + toOnePrefetch.getClass().getName(),
                    toOnePrefetch instanceof DataObject);

            DataObject pk1 = (DataObject) toOnePrefetch;
            assertEquals(PersistenceState.COMMITTED, pk1.getPersistenceState());
            assertEquals("CPK2", pk1.readPropertyDirectly("name"));
        }
        finally {
            unblockQueries();
        }
    }
View Full Code Here


     */
    public Object getValue(Object object) throws PropertyException {
        try {

            DataObject dataObject = (DataObject) object;
            return dataObject.readPropertyDirectly(propertyName);
        }
        catch (ClassCastException e) {
            throw new PropertyException("Object is not a DataObject: '"
                    + object.getClass().getName()
                    + "'", this, object, e);
View Full Code Here

     */
    public Object getValue(Object object) throws PropertyException {
        try {

            DataObject dataObject = (DataObject) object;
            return dataObject.readPropertyDirectly(propertyName);
        }
        catch (ClassCastException e) {
            throw new PropertyException("Object is not a DataObject: '"
                    + object.getClass().getName()
                    + "'", this, object, e);
View Full Code Here

                    "Expected DataObject, got: " + toOnePrefetch.getClass().getName(),
                    toOnePrefetch instanceof DataObject);

            DataObject pk1 = (DataObject) toOnePrefetch;
            assertEquals(PersistenceState.COMMITTED, pk1.getPersistenceState());
            assertEquals("CPK2", pk1.readPropertyDirectly("name"));
        }
        finally {
            unblockQueries();
        }
    }
View Full Code Here

     */
    public Object readPropertyDirectly(Object object) throws PropertyAccessException {
        try {

            DataObject dataObject = (DataObject) object;
            return dataObject.readPropertyDirectly(propertyName);
        }
        catch (ClassCastException e) {
            throw new PropertyAccessException("Object is not a DataObject: '"
                    + object.getClass().getName()
                    + "'", this, object, e);
View Full Code Here

    private final void clearNullRelationships(List parentObjects) {
        Iterator it = parentObjects.iterator();
        while (it.hasNext()) {
            DataObject object = (DataObject) it.next();
            if (object.readPropertyDirectly(name) instanceof Fault) {
                object.writeProperty(name, null);
            }
        }
    }
View Full Code Here

                }

                // handle meaningful PK
                ObjAttribute objAttr = objEntity.getAttributeForDbAttribute(dbAttr);
                if (objAttr != null) {
                    idMap.put(dbAttrName, object.readPropertyDirectly(objAttr.getName()));
                    continue;
                }

                // only a single key can be generated from DB... if this is done already
                // in this loop, we must bail out.
View Full Code Here

        for (int i = 0; i < nobjects; i++) {
            DataObject object = (DataObject) objects.get(i);
            ObjectId oid = object.getObjectId();
            Object list = listMap.get(oid.getValueForAttribute(dbKey));

            ((ValueHolder) object.readPropertyDirectly(relName)).setValueDirectly(list);
        }
    }
}
View Full Code Here

                    continue;
                }

                ObjAttribute objAttr = objEntity.getAttributeForDbAttribute(dbAttr);
                if (objAttr != null) {
                    idMap.put(dbAttrName, object.readPropertyDirectly(objAttr.getName()));
                    continue;
                }

                // only a single key can be generated from DB... if this is done already
                // in this loop, we must bail out.
View Full Code Here

                "Expected DataObject, got: " + toOnePrefetch.getClass().getName(),
                toOnePrefetch instanceof DataObject);

        DataObject pk1 = (DataObject) toOnePrefetch;
        assertEquals(PersistenceState.COMMITTED, pk1.getPersistenceState());
        assertEquals("CPK2", pk1.readPropertyDirectly("name"));
    }

    /**
     * Tests to-many prefetching over relationships with compound keys.
     */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.