Package org.apache.cayenne.property

Examples of org.apache.cayenne.property.ClassDescriptor.createObject()


            // indistinguishible) case of such object passed from parent, we let it
            // slip... Not sure what's the best way of handling it that does not involve
            // breaking encapsulation of the DataChannel to detect where in the hierarchy
            // this context is.

            Persistent localObject = (Persistent) descriptor.createObject();

            localObject.setObjectContext(this);
            localObject.setObjectId(id);

            getGraphManager().registerNode(id, localObject);
View Full Code Here


    Persistent createNewObject(ObjectId id) {
        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                id.getEntityName());

        Persistent object = (Persistent) descriptor.createObject();

        object.setPersistenceState(PersistenceState.NEW);
        object.setObjectContext(this);
        object.setObjectId(id);
View Full Code Here

    Persistent createFault(ObjectId id) {
        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                id.getEntityName());

        Persistent object = (Persistent) descriptor.createObject();

        object.setPersistenceState(PersistenceState.HOLLOW);
        object.setObjectContext(this);
        object.setObjectId(id);
View Full Code Here

            throw new IllegalArgumentException("Invalid entity name: " + objEntityName);
        }

        DataObject dataObject;
        try {
            dataObject = (DataObject) descriptor.createObject();
        }
        catch (Exception ex) {
            throw new CayenneRuntimeException("Error instantiating object.", ex);
        }
View Full Code Here

            return cachedObject;
        }
        // create and merge into a new object
        else {

            Persistent localObject = (Persistent) descriptor.createObject();

            localObject.setObjectContext(this);
            localObject.setObjectId(id);

            getGraphManager().registerNode(id, localObject);
View Full Code Here

            throw new IllegalArgumentException("Invalid entity name: " + objEntityName);
        }

        DataObject dataObject;
        try {
            dataObject = (DataObject) descriptor.createObject();
        }
        catch (Exception ex) {
            throw new CayenneRuntimeException("Error instantiating object.", ex);
        }
View Full Code Here

        else {

            Persistent localObject;

            synchronized (getGraphManager()) {
                localObject = (Persistent) descriptor.createObject();

                localObject.setObjectContext(this);
                localObject.setObjectId(id);

                getGraphManager().registerNode(id, localObject);
View Full Code Here

            // breaking encapsulation of the DataChannel to detect where in the hierarchy
            // this context is.

            Persistent localObject;
            synchronized (getGraphManager()) {
                localObject = (Persistent) descriptor.createObject();

                localObject.setObjectContext(this);
                localObject.setObjectId(id);

                getGraphManager().registerNode(id, localObject);
View Full Code Here

    Persistent createNewObject(ObjectId id) {
        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                id.getEntityName());

        Persistent object = (Persistent) descriptor.createObject();

        // must follow this exact order of property initialization per CAY-653, i.e. have
        // the id and the context in place BEFORE setPersistence is called
        object.setObjectId(id);
        object.setObjectContext(this);
View Full Code Here

        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                id.getEntityName());

        Persistent object;
        synchronized(graphManager) {
            object = (Persistent) descriptor.createObject();

            object.setPersistenceState(PersistenceState.HOLLOW);
            object.setObjectContext(this);
            object.setObjectId(id);
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.