Package com.impetus.kundera.persistence

Examples of com.impetus.kundera.persistence.EntityReader


        Client client = nodeStateContext.getClient();
        Class<?> nodeDataClass = nodeStateContext.getDataClass();
        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(nodeStateContext.getPersistenceDelegator().getKunderaMetadata(), nodeDataClass);
        Object entityId = nodeStateContext.getEntityId();

        EntityReader reader = client.getReader();
        EnhanceEntity ee = reader.findById(entityId, entityMetadata, client);

        if (ee != null && ee.getEntity() != null)
        {
            Object nodeData = ee.getEntity();
            nodeStateContext.setData(nodeData);
View Full Code Here


        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(nodeStateContext.getPersistenceDelegator().getKunderaMetadata(), nodeDataClass);
        Object entityId = nodeStateContext.getEntityId();

        Object nodeData = null; // Node data

        EntityReader reader = client.getReader();
        if (reader == null)
        {
            return;
        }

        EnhanceEntity ee = reader.findById(entityId, entityMetadata, client);
        // Recursively retrieve relationship entities (if there are any)
        if (ee != null && ee.getEntity() != null)
        {
            Object entity = ee.getEntity();

            if ((entityMetadata.getRelationNames() == null || entityMetadata.getRelationNames().isEmpty())
                    && !entityMetadata.isRelationViaJoinTable())
            {
                // There is no relation (not even via Join Table), Construct
                // Node out of this enhance entity,
                nodeData = entity;
            }

            else
            {
                // This entity has associated entities, find them recursively.
                nodeData = reader.recursivelyFindEntities(ee.getEntity(), ee.getRelations(), entityMetadata,
                        nodeStateContext.getPersistenceDelegator(), false);
            }
        }

        // Construct Node out of this entity and put into Persistence Cache
View Full Code Here

TOP

Related Classes of com.impetus.kundera.persistence.EntityReader

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.