Examples of PersistenceDelegator


Examples of com.impetus.kundera.persistence.PersistenceDelegator

      logger.warn(e.getMessage());
    } catch (NoSuchMethodException e) {
      logger.warn(e.getMessage());
    }
    getpd.setAccessible(true);
    PersistenceDelegator pd = null;
    try {
      pd = (PersistenceDelegator) getpd.invoke(em);
    } catch (IllegalArgumentException e) {
      logger.warn(e.getMessage());
    } catch (IllegalAccessException e) {
      logger.warn(e.getMessage());
    } catch (InvocationTargetException e) {
      logger.warn(e.getMessage());
    }

    KunderaMetadata kunderaMetadata = ((EntityManagerFactoryImpl) emf)
        .getKunderaMetadataInstance();

    CassQuery query = new CassQuery(kunderaQuery, pd, kunderaMetadata);
    query.setMaxResults(maxResult);

    EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(
        kunderaMetadata, entityClass);
    Metamodel metaModel = KunderaMetadataManager.getMetamodel(
        kunderaMetadata, puName);

    Client<CassQuery> client = pd.getClient(metadata);

    String cqlQuery = query.onQueryOverCQL3(metadata, client,
        (MetamodelImpl) metaModel, metadata.getRelationNames());
    return cqlQuery;
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

        EntityManagerFactory emf = Persistence.createEntityManagerFactory("kunderatest");
        Constructor constructor = PersistenceDelegator.class.getDeclaredConstructor(KunderaMetadata.class,
                PersistenceCache.class);
        constructor.setAccessible(true);
        PersistenceDelegator pd = (PersistenceDelegator) constructor.newInstance(
                ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance(), new PersistenceCache());

        storeNode.setPersistenceDelegator(pd);
       
        state.handleMerge(storeNode);
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

        p.setSubaddresses(subaddresses);

        Relation relation = new Relation(AddressEntity.class.getDeclaredField("subaddresses"), AddressEntity.class,
                Set.class, FetchType.LAZY, null, false, null, ForeignKey.ONE_TO_MANY);
        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);
        ProxyMap proxyMap = new ProxyMap(delegator, relation);

        proxyMap.setOwner(p);

        assertOnProxyMap(p, relation, delegator, proxyMap);
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

       
        person.setAddresses(addresses);

        Relation relation = new Relation(PersonUMMByMap.class.getDeclaredField("addresses"), AddressUMM.class,
                Set.class, FetchType.LAZY, null, false, null, ForeignKey.MANY_TO_MANY);
        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);
        ProxyMap proxyMap = new ProxyMap(delegator, relation);

        proxyMap.setOwner(person);

        assertOnProxyMap(person, relation, delegator, proxyMap);
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

        p.setSubaddresses(subaddresses);

        Relation relation = new Relation(AddressEntity.class.getDeclaredField("subaddresses"), AddressEntity.class,
                Set.class, FetchType.LAZY, null, false, null, ForeignKey.ONE_TO_MANY);
        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);
        ProxySet proxySet = new ProxySet(delegator, relation);

        proxySet.setOwner(p);
        proxySet.add(p);
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

        p.setSubaddresses(subaddresses);

        Relation relation = new Relation(AddressEntityWithList.class.getDeclaredField("subaddresses"), AddressEntityWithList.class,
                List.class, FetchType.LAZY, null, false, null, ForeignKey.ONE_TO_MANY);
        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);
        ProxyList proxyList = new ProxyList(delegator, relation);

        proxyList.setOwner(p);
        proxyList.add(0,p);
       
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

    }

    @Test
    public void testWithPDInstance() throws NoSuchMethodException, Throwable
    {
        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);
        PersonnelDTO dto = new PersonnelDTO("1", "vivek", "mishra");
        em.persist(dto);
        LazyInitializerFactory factory = kunderaMetadata.getCoreMetadata().getLazyInitializerFactory();
        KunderaProxy proxy = factory.getProxy("personnel#1", PersonnelDTO.class, null, null, "1", delegator);
        LazyInitializer li = proxy.getKunderaLazyInitializer();
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

    }
   
    @Test
    public void testWithClosedPDInstance() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
    {
        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);
        PersonnelDTO dto = new PersonnelDTO("1", "vivek", "mishra");
        em.persist(dto);
        em.close();

        LazyInitializerFactory factory = kunderaMetadata.getCoreMetadata().getLazyInitializerFactory();
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

        EntityManagerFactory emf = Persistence.createEntityManagerFactory("kunderatest");
        Constructor constructor = PersistenceDelegator.class.getDeclaredConstructor(KunderaMetadata.class,
                PersistenceCache.class);
        constructor.setAccessible(true);
        PersistenceDelegator pd = (PersistenceDelegator) constructor.newInstance(
                ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance(), new PersistenceCache());

        storeNode.setPersistenceDelegator(pd);

        state.handlePersist(storeNode);
View Full Code Here

Examples of com.impetus.kundera.persistence.PersistenceDelegator

        EntityManagerFactory emf = Persistence.createEntityManagerFactory("kunderatest");
        Constructor constructor = PersistenceDelegator.class.getDeclaredConstructor(KunderaMetadata.class,
                PersistenceCache.class);
        constructor.setAccessible(true);
        PersistenceDelegator pd = (PersistenceDelegator) constructor.newInstance(
                ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance(), new PersistenceCache());

        storeNode.setPersistenceDelegator(pd);

        Object data1 = storeNode.getData();
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.