Package org.b3log.latke.repository

Examples of org.b3log.latke.repository.PropertyFilter


     * @param email the specified email
     * @return user, returns {@code null} if not found
     */
    public JSONObject getByEmail(final String email) {
        final Query query = new Query();
        query.setFilter(new PropertyFilter(User.USER_EMAIL, FilterOperator.EQUAL, email.toLowerCase().trim()));

        try {
            final JSONObject result = get(query);
            final JSONArray array = result.getJSONArray(Keys.RESULTS);

View Full Code Here


     *
     * @return administrator, returns {@code null} if not found
     */
    public JSONObject getAdmin() {
        final Query query = new Query();
        query.setFilter(new PropertyFilter(User.USER_ROLE, FilterOperator.EQUAL, Role.ADMIN_ROLE));

        try {
            final JSONObject result = get(query);
            final JSONArray array = result.getJSONArray(Keys.RESULTS);

View Full Code Here

            for (final String[] index : indexes) {
                final org.b3log.latke.repository.Query futureQuery = new org.b3log.latke.repository.Query().setPageCount(1);
                for (int j = 0; j < index.length; j++) {
                    final String propertyName = index[j];

                    futureQuery.setFilter(new PropertyFilter(propertyName, FilterOperator.EQUAL, jsonObject.opt(propertyName)));
                    logMsgBuilder.append(propertyName).append(",");
                }

                if (logMsgBuilder.length() > 0) {
                    logMsgBuilder.deleteCharAt(logMsgBuilder.length() - 1);
View Full Code Here

        inList.add(new Integer("1"));
        inList.add(new Integer("2"));
        inList.add(new Integer("3"));

        query.setFilter(CompositeFilterOperator.and(
                new PropertyFilter("col1", FilterOperator.EQUAL, new Integer("1")),
                new PropertyFilter("col1", FilterOperator.GREATER_THAN, new Integer("1")),
                new PropertyFilter("col1", FilterOperator.GREATER_THAN_OR_EQUAL, new Integer("1")),
                new PropertyFilter("col1", FilterOperator.LESS_THAN, new Integer("1")),
                new PropertyFilter("col1", FilterOperator.LESS_THAN_OR_EQUAL, new Integer("1")),
                new PropertyFilter("col1", FilterOperator.NOT_EQUAL, new Integer("1")),
                new PropertyFilter("col1", FilterOperator.IN, inList),
                new CompositeFilter(
                CompositeFilterOperator.OR,
                Arrays.<Filter>asList(new PropertyFilter("col1", FilterOperator.EQUAL, new Integer("1")),
                                      new PropertyFilter("col1", FilterOperator.LESS_THAN_OR_EQUAL, new Integer("1"))))));

        jdbcRepository.get(query);
    }
View Full Code Here

            jsonObject.remove(JdbcRepositories.OID);
        }
        transaction.commit();

        final Query query = new Query();
        query.setFilter(new PropertyFilter("col1", FilterOperator.EQUAL, new Integer("100")));
        query.addProjection("col1", String.class);
        query.addProjection("col2", String.class);
        query.addSort("oId", SortDirection.ASCENDING);
        query.setPageSize(new Integer("4"));
        query.setCurrentPageNum(2);
View Full Code Here

            for (final String[] index : indexes) {
                final org.b3log.latke.repository.Query futureQuery = new org.b3log.latke.repository.Query().setPageCount(1);
                for (int j = 0; j < index.length; j++) {
                    final String propertyName = index[j];

                    futureQuery.setFilter(new PropertyFilter(propertyName, FilterOperator.EQUAL, jsonObject.opt(propertyName)));
                    logMsgBuilder.append(propertyName).append(",");
                }
                logMsgBuilder.deleteCharAt(logMsgBuilder.length() - 1); // Removes the last comma

                cacheKey = CACHE_KEY_PREFIX + futureQuery.getCacheKey() + "_" + getName();
View Full Code Here

TOP

Related Classes of org.b3log.latke.repository.PropertyFilter

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.