Package org.easycassandra.ClassInformation

Examples of org.easycassandra.ClassInformation.KeySpaceInformation


        return resultSet.all().get(0).getLong(0);
    }

    protected Select prepareCount(Class<?> bean, ConsistencyLevel consistency) {
        ClassInformation classInformation = ClassInformations.INSTACE.getClass(bean);
        KeySpaceInformation key = classInformation.getKeySpace(keySpace);
        Select select = QueryBuilder.select().countAll()
                .from(key.getKeySpace(), key.getColumnFamily());
        select.setConsistencyLevel(consistency);
        return select;
    }
View Full Code Here


            String keySpace) {
        this.session = session;

        this.classBean = classBean;

        KeySpaceInformation keySpaceInformation = classBean.getKeySpace(keySpace);
        select = QueryBuilder.select(CreateColumns.INSTANCE
                .getColumns(classBean).toArray(new String[0])).from(
                        keySpaceInformation.getKeySpace(), keySpaceInformation.getColumnFamily());
    }
View Full Code Here

        String familyColumn = classInformation.getNameSchema();
        if (!classInformation.getSchema().equals("")) {
            getTemplate(classInformation.getSchema());

        }
        KeySpaceInformation key = classInformation.getKeySpace(getKeySpace());
        Session session = getCluster().connect(key.getKeySpace());
        return fixColumnFamily(session, familyColumn, entity);
  }
View Full Code Here

        if (key == null) {
            throw new KeyProblemsException(
                    "The parameter key to column family should be passed");
        }
        ClassInformation classInformations = ClassInformations.INSTACE.getClass(bean);
        KeySpaceInformation keyInformation = classInformations.getKeySpace(keySpace);

        Update update = QueryBuilder.update(keyInformation.getKeySpace(),
                        keyInformation.getColumnFamily());

        FieldInformation keyField = classInformations.getKeyInformation();
        if (classInformations.isComplexKey()) {
            runComplexKey(update, key, keyField.getSubFields().getFields());
        } else {
View Full Code Here

     * @param columnNames the columns to remove
     */
    public DeleteBuilderImpl(Session session, ClassInformation classBean,
            String keySpace, Delete delete, String... columnNames) {
        this.session = session;
        KeySpaceInformation keySpaceInformation = classBean
                .getKeySpace(keySpace);

        this.classBean = classBean;
        if (delete == null) {
            this.delete = QueryBuilder.delete().from(
                    keySpaceInformation.getKeySpace(),
                    keySpaceInformation.getColumnFamily());
        } else {
            this.delete = delete;
        }

    }
View Full Code Here

        String familyColumn = classInformation.getNameSchema();
        if (!classInformation.getSchema().equals("")) {
            getTemplate(classInformation.getSchema());

        }
        KeySpaceInformation key = classInformation.getKeySpace(getKeySpace());
        Session session = getCluster().connect(key.getKeySpace());
        classes.add(class1);
        return fixColumnFamily(session, familyColumn, class1);
    }
View Full Code Here

    }

    public <T> Insert createStatment(T bean, ConsistencyLevel consistency) {
        ClassInformation classInformation = ClassInformations.INSTACE.getClass(bean.getClass());
        isKeyNull(bean, classInformation);
        KeySpaceInformation key = classInformation.getKeySpace(keySpace);
        Insert insert = QueryBuilder.insertInto(key.getKeySpace(), key.getColumnFamily());
        insert = createInsert(bean, insert, classInformation);
        insert.setConsistencyLevel(consistency);
        return insert;
    }
View Full Code Here

        if (!classInformation.getSchema().equals("")) {
            getPersistence(classInformation.getSchema());

        }
        classes.add(class1);
        KeySpaceInformation key = classInformation.getKeySpace(keySpace);
        Session session = getCluster().connect(key.getKeySpace());
        return new FixColumnFamily().verifyColumnFamily(session, key.getKeySpace(),
                key.getColumnFamily(), class1);
    }
View Full Code Here

        this.session = session;
        this.classBean = classBean;

        if (update == null) {
            KeySpaceInformation keySpaceInformation = classBean
                    .getKeySpace(keySpace);
            this.update = QueryBuilder.update(keySpaceInformation.getKeySpace(),
                    keySpaceInformation.getColumnFamily());
        } else {
            this.update = update;
        }

    }
View Full Code Here

     */
    protected <T> QueryBean createQueryBean(Class<T> bean,
            ConsistencyLevel consistency) {
        ClassInformation classInformation = ClassInformations.INSTACE.getClass(bean);
        QueryBean byKeyBean = prepare(new QueryBean(), classInformation);
        KeySpaceInformation keySpaceInformation = classInformation.getKeySpace(keySpace);
        byKeyBean.select = QueryBuilder.select(byKeyBean.getArray()).from(
                keySpaceInformation.getKeySpace(), keySpaceInformation.getColumnFamily());
        byKeyBean.select.setConsistencyLevel(consistency);
        return byKeyBean;
    }
View Full Code Here

TOP

Related Classes of org.easycassandra.ClassInformation.KeySpaceInformation

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.