All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fingertip.simpledao.query.C Maven / Gradle / Ivy

The newest version!
package org.fingertip.simpledao.query;

import org.fingertip.simpledao.enums.JoinType;

import java.util.List;

public class C {
    
    public static ICriteria eq(String field, Object value) {
        return new Criteria().eq(field, value);
    }

    public static ICriteria ne(String field, Object value) {
        return new Criteria().ne(field, value);
    }

    public static ICriteria gt(String field, Object value) {
        return new Criteria().gt(field, value);
    }

    public static ICriteria gte(String field, Object value) {
        return new Criteria().gte(field, value);
    }

    public static ICriteria lt(String field, Object value) {
        return new Criteria().lt(field, value);
    }

    public static ICriteria lte(String field, Object value) {
        return new Criteria().lte(field, value);
    }

    public static ICriteria like(String field, Object value) {
        return new Criteria().like(field, value);
    }

    public static ICriteria in(String field, List values) {
        return new Criteria().in(field, values);
    }

    public static ICriteria in(String field, Object... values) {
        return new Criteria().in(field, values);
    }

    public static ICriteria nin(String field, List values) {
        return new Criteria().nin(field, values);
    }

    public static ICriteria nin(String field, Object... values) {
        return new Criteria().nin(field, values);
    }

    public static ICriteria between(String field, Object start, Object end) {
        return new Criteria().between(field, start,end);
    }

    public static ICriteria and(IQuery... queries) {
        return new Criteria().and(queries);
    }

    public static ICriteria or(IQuery... queries) {
        return new Criteria().or(queries);
    }

    public static ICriteria or(IQuery query) {
        return new Criteria().or(query);
    }

    public static ICriteria isNull(String field) {
        return new Criteria().isNull(field);
    }

    public static ICriteria isNotNull(String field) {
        return new Criteria().isNotNull(field);
    }

    public static ICriteria limit(int size) {
        return new Criteria().limit(size);
    }

    public static ICriteria limit(int from, int size) {
        return new Criteria().limit(from,size);
    }

    public static JoinQuery leftJoin(String table, ICriteria... queries) {
        return new JoinQuery(JoinType.LEFT, table, queries);
    }

    public static JoinQuery rightJoin(String table, ICriteria... queries) {
        return new JoinQuery(JoinType.RIGHT, table, queries);
    }

    public static JoinQuery innerJoin(String table, ICriteria... queries) {
        return new JoinQuery(JoinType.INNER, table, queries);
    }

    public static JoinQuery leftJoin(String table,JoinQuery joinQuery, ICriteria... queries) {
        JoinQuery leftJoin = new JoinQuery(JoinType.LEFT, table, queries);
        leftJoin.setJoinQuery(joinQuery);
        return leftJoin;
    }

    public static JoinQuery rightJoin(String table,JoinQuery joinQuery, ICriteria... queries) {
        JoinQuery rightJoin = C.rightJoin(table, queries);
        rightJoin.setJoinQuery(joinQuery);
        return rightJoin;
    }

    public static JoinQuery innerJoin(String table,JoinQuery joinQuery, ICriteria... queries) {
        JoinQuery innerJoin = C.innerJoin(table, queries);
        innerJoin.setJoinQuery(joinQuery);
        return innerJoin;
    }
}