Package com.impetus.kundera.lifecycle.states

Examples of com.impetus.kundera.lifecycle.states.ManagedState


                this.state = state != null ? this.state : new TransientState();

                node = new Node(
                        nodeId,
                        entity,
                        ((Field) entityMetadata.getIdAttribute().getJavaMember()).isAnnotationPresent(EmbeddedId.class) ? new ManagedState()
                                : this.state, pd.getPersistenceCache(), entityId, pd);
            }
            else
            {
                node = nodeInPersistenceCache;
View Full Code Here


        if (l2Cache != null)
        {
            Object entity = l2Cache.get(nodeId);
            if (entity != null)
            {
                node = new Node(nodeId, entity.getClass(), new ManagedState(), this.persistenceCache,
                        nodeId.substring(nodeId.indexOf("$") + 1), pd);
                node.setData(entity);
            }
        }
View Full Code Here

        Node node = mainCache.getNodeFromCache(nodeId, this);

        // if node is not in persistence cache or is dirty, fetch from database
        if (node == null || node.isDirty())
        {
            node = new Node(nodeId, entityClass, new ManagedState(), getPersistenceCache(), primaryKey, this);
            node.setClient(getClient(entityMetadata));
            // TODO ManagedState.java require serious attention.
            node.setPersistenceDelegator(this);

            try
View Full Code Here

        }

        EntityMetadata metadata = getMetadata(e.getClass());

        // Create an object graph of the entity object
        ObjectGraph graph = new GraphGenerator().generateGraph(e, this, new ManagedState());

        Node node = graph.getHeadNode();

        try
        {
View Full Code Here

     */
    public static void addEntityToPersistenceCache(Object entity, PersistenceDelegator pd, Object entityId)
    {
        MainCache mainCache = (MainCache) pd.getPersistenceCache().getMainCache();
        String nodeId = ObjectGraphUtils.getNodeId(entityId, entity.getClass());
        Node node = new Node(nodeId, entity.getClass(), new ManagedState(), pd.getPersistenceCache(), entityId, pd);
        node.setData(entity);
        node.setPersistenceDelegator(pd);
        mainCache.addNodeToCache(node);
    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.lifecycle.states.ManagedState

Copyright © 2018 www.massapicom. 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.