Examples of JSDBCondition


Examples of org.sf.bee.jsdb.expressions.JSDBCondition

    public JSONObject find(final String id) {
        return this.getById(id);
    }

    public JSONObject findOne(final String field, final Object value) {
        final JSDBCondition condition = new JSDBCondition(field, value);
        return this.getOneFieldValue(new JSDBCondition[]{condition});
    }
View Full Code Here

Examples of org.sf.bee.jsdb.expressions.JSDBCondition

    public List<JSONObject> find() {
        return this.getAll();
    }

    public List<JSONObject> find(final String field, final Object value) {
        final JSDBCondition condition = new JSDBCondition(field, OP_EQUALS, value);
        return this.getByFieldValue(new JSDBCondition[]{condition});
    }
View Full Code Here

Examples of org.sf.bee.jsdb.expressions.JSDBCondition

        return this.getByFieldValue(new JSDBCondition[]{condition});
    }

    public List<JSONObject> find(final String field, final String operator,
            final Object value) {
        final JSDBCondition condition = new JSDBCondition(field, operator, value);
        return this.getByFieldValue(new JSDBCondition[]{condition});
    }
View Full Code Here

Examples of org.sf.bee.jsdb.expressions.JSDBCondition

        return this.getByFieldValue(conditions);
    }

    public Map<String, List<JSONObject>> group(final String field,
            final String operator, final Object value) {
        final JSDBCondition condition = new JSDBCondition(field, operator, value);
        return this.group(field,
                new JSDBCondition[]{condition});
    }
View Full Code Here

Examples of org.sf.bee.jsdb.expressions.JSDBCondition

        return this.getTree(expression, leafCaption);
    }

    public JSONObject upsert(final JSONObject item) {
        final String id = JSDBObject.getId(item);
        final JSDBCondition condition = new JSDBCondition(ID, id);
        final int index = this.getIndexOf(new JSDBCondition[]{condition});
        if (index > -1) {
            this.remove(index);
        }
        this.put(item);
View Full Code Here

Examples of org.sf.bee.jsdb.expressions.JSDBCondition

            }
        }
    }

    public JSONObject remove(final String id) {
        final JSDBCondition condition = new JSDBCondition(ID, id);
        final int index = this.getIndexOf(new JSDBCondition[]{condition});
        if (index > -1) {
            return (JSONObject) this.remove(index);
        }
        return null;
View Full Code Here

Examples of org.sf.bee.jsdb.expressions.JSDBCondition

    public int remove(final String field, final Object value) {
        if (field.equalsIgnoreCase(ID) && null != value) {
            this.remove(value.toString());
            return 1;
        } else {
            final JSDBCondition condition = new JSDBCondition(field, value);
            return this.remove(new JSDBCondition[]{condition});
        }
    }
View Full Code Here

Examples of org.sf.bee.jsdb.expressions.JSDBCondition

    public int remove(final JSDBCondition[] conditions) {
        int counter = 0;
        final List<JSONObject> list = this.find(conditions);
        for (final JSONObject item : list) {
            final String id = JSDBObject.getId(item);
            final JSDBCondition condition = new JSDBCondition(ID, id);
            final int index = this.getIndexOf(new JSDBCondition[]{condition});
            if (index > -1) {
                this.remove(index);
                counter++;
            }
View Full Code Here

Examples of org.sf.bee.jsdb.expressions.JSDBCondition

            return -1;
        }
    }

    private JSONObject getById(final String id) {
        final JSDBCondition condition = new JSDBCondition(ID, id);
        return this.getOneFieldValue(new JSDBCondition[]{condition});
    }
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.