Package com.impetus.kundera.client

Examples of com.impetus.kundera.client.Client


        CassandraCli.cassandraSetUp();
        CassandraCli.initClient();
        emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT,puProperties);
        em = emf.createEntityManager();
        Map<String, Client> clients = (Map<String, Client>) em.getDelegate();
        Client client = clients.get(PERSISTENCE_UNIT);
        ((CassandraClientBase) client).setCqlVersion(CassandraConstants.CQL_VERSION_3_0);
    }
View Full Code Here


                (short) 8, (float) 69.3, 163.76765654, enrolmentDate, enrolmentTime, joiningDateAndTime,
                new Integer(3), new Long(978423946455l), 135434.89, newSqlDate, sqlTime, sqlTimestamp, bigDecimal,
                bigInteger, calendar, CompoundKeyDataType.class.newInstance());

        Map<String, Client> clients = (Map<String, Client>) em.getDelegate();
        Client client = clients.get(PERSISTENCE_UNIT);
        ((CassandraClientBase) client).setCqlVersion("3.0.0");
        PrimeUserDataType user = new PrimeUserDataType(key);
        user.setTweetBody("my first tweet");
        user.setTweetDate(currentDate);
        user.setIsActive(true);
View Full Code Here

                (short) 8, (float) 69.3, 163.76765654, enrolmentDate, enrolmentTime, joiningDateAndTime,
                new Integer(3), new Long(978423946455l), 135434.89, newSqlDate, sqlTime, sqlTimestamp, bigDecimal,
                bigInteger, calendar, CompoundKeyDataType.class.newInstance());

        Map<String, Client> clients = (Map<String, Client>) em.getDelegate();
        Client client = clients.get(PERSISTENCE_UNIT);
        ((CassandraClientBase) client).setCqlVersion(CassandraConstants.CQL_VERSION_3_0);

        PrimeUserDataType user = new PrimeUserDataType(key);
        user.setTweetBody("my first tweet");
        user.setTweetDate(currentDate);
View Full Code Here

    private void updateNamed() throws InstantiationException, IllegalAccessException
    {
        EntityManager em = emf.createEntityManager();

        Map<String, Client> clients = (Map<String, Client>) em.getDelegate();
        Client client = clients.get(PERSISTENCE_UNIT);
        ((CassandraClientBase) client).setCqlVersion("3.0.0");

        UUID timeLineId = UUID.randomUUID();
        Date currentDate = new Date();
        CompoundKeyDataType key = prepareData(new Long(12345677), 78575785897L, "Amresh", false, 10, 'A', (byte) 5,
View Full Code Here

                bigInteger, calendar, CompoundKeyDataType.class.newInstance());

        String deleteQuery = "Delete From PrimeUserDataType u where u.key= :key";
        EntityManager em = emf.createEntityManager();
        Map<String, Client> clients = (Map<String, Client>) em.getDelegate();
        Client client = clients.get(PERSISTENCE_UNIT);
        ((CassandraClientBase) client).setCqlVersion("3.0.0");

        Query q = em.createQuery(deleteQuery);
        q.setParameter("key", key);
        q.executeUpdate();
View Full Code Here

        if (kunderaQuery.isNative())
        {
            throw new UnsupportedOperationException("Iteration not supported over native queries");
        }
        EntityMetadata m = getEntityMetadata();
        Client client = persistenceDelegeator.getClient(m);
        externalProperties = ((CassandraClientBase) client).getExternalProperties();

        if (!MetadataUtils.useSecondryIndex(((ClientBase) client).getClientMetadata()))
        {
            throw new UnsupportedOperationException("Scrolling over cassandra is unsupported for lucene queries");
View Full Code Here

    @Override
    protected int onExecuteUpdate()
    {
        EntityMetadata m = getEntityMetadata();

        Client client = persistenceDelegeator.getClient(m);
        return ((HibernateClient) client).onExecuteUpdate(getJPAQuery(), getParamaters());
    }
View Full Code Here

            throw new UnsupportedOperationException("Iteration not supported over native queries");
        }

        initializeReader();
        EntityMetadata m = getEntityMetadata();
        Client client = persistenceDelegeator.getClient(m);
        return new ResultIterator((HibernateClient) client, m, persistenceDelegeator,
                getFetchSize() != null ? getFetchSize() : this.maxResult,
                ((RDBMSEntityReader) getReader()).getSqlQueryFromJPA(m, m.getRelationNames(), null));
    }
View Full Code Here

    public void handleFlush(NodeStateContext nodeStateContext)
    {
        // Entity state to remain as Removed

        // Flush this node to database
        Client client = nodeStateContext.getClient();

        Node node = (Node) nodeStateContext;

        Object entityId = node.getEntityId();

        client.delete(node.getData(), entityId);

        // Since node is flushed, mark it as NOT dirty
        nodeStateContext.setDirty(false);

        // Remove this node from Persistence Cache
View Full Code Here

    @Override
    public void handleRefresh(NodeStateContext nodeStateContext)
    {
        // Refresh entity state from the database
        // Fetch Node data from Client
        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();
View Full Code Here

TOP

Related Classes of com.impetus.kundera.client.Client

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.