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

com.mycomm.itool.utils.MyQueryCondition Maven / Gradle / Ivy

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycomm.itool.utils;

import java.util.Map;

/**
 *
 * @author jw362j
 */
public class MyQueryCondition {

    private long firstindex;
    private int maxresult;
    private String[] colums;//{"id","theName","f","de"}; 
    private String wheresql;// where = " age = ? and theName = ?";
    private Object[] queryParamsNames;//new Object[]{222, "wangjiunian312"};
    private int[] queryParamsTypes;//new int[]{java.sql.Types.INTEGER, java.sql.Types.VARCHAR};
    private Map orderby;// orderby = new LinkedHashMap();orderby.put("id", "asc");orderby.put("age", "desc");    

    public MyQueryCondition() {
    }
    
    public MyQueryCondition(long firstindex, int maxresult) {
          this(firstindex, maxresult, null, null, null, null, null);
    }

    public MyQueryCondition(long firstindex, int maxresult, String[] colums, String wheresql, Object[] queryParamsNames, int[] queryParamsTypes, Map orderby) {
        this.firstindex = firstindex;
        this.maxresult = maxresult;
        this.colums = colums;
        this.wheresql = wheresql;
        this.queryParamsNames = queryParamsNames;
        this.queryParamsTypes = queryParamsTypes;
        this.orderby = orderby;
    }

    public long getFirstindex() {
        return firstindex;
    }

    public MyQueryCondition setFirstindex(int firstindex) {
        this.firstindex = firstindex;
        return MyQueryCondition.this;
    }

    public int getMaxresult() {
        return maxresult;
    }

    public MyQueryCondition setMaxresult(int maxresult) {
        this.maxresult = maxresult;
        return MyQueryCondition.this;
    }

    public String[] getColums() {
        return colums;
    }

    public MyQueryCondition setColums(String[] colums) {
        this.colums = colums;
        return MyQueryCondition.this;
    }
 

    public Object[] getQueryParamsNames() {
        return queryParamsNames;
    }

    public MyQueryCondition setQueryParamsNames(Object[] queryParamsNames) {
        this.queryParamsNames = queryParamsNames;
        return MyQueryCondition.this;
    }

    public int[] getQueryParamsTypes() {
        return queryParamsTypes;
    }

    public MyQueryCondition setQueryParamsTypes(int[] queryParamsTypes) {
        this.queryParamsTypes = queryParamsTypes;
        return MyQueryCondition.this;
    }

    public Map getOrderby() {
        return orderby;
    }

    public MyQueryCondition setOrderby(Map orderby) {
        this.orderby = orderby;
        return MyQueryCondition.this;
    }   

    public String getWheresql() {
        return wheresql;
    }

    public void setWheresql(String wheresql) {
        this.wheresql = wheresql;
    }

    @Override
    public String toString() {
        return "MyQueryCondition{" + "firstindex=" + firstindex + ", maxresult=" + maxresult + ", colums=" + colums + ", wheresql=" + wheresql + ", queryParamsNames=" + queryParamsNames + ", queryParamsTypes=" + queryParamsTypes + ", orderby=" + orderby + '}';
    }

    
    
    

    public void testSample() {
        /**
        String colums[] = {"id", "theName", "f", "de"};
        String where = " age = ? and theName = ? ";
        Object[] queryParamsNames = new Object[]{222, "wangjiunian312"};
        int[] queryParamsTypes = new int[]{java.sql.Types.INTEGER, java.sql.Types.VARCHAR};
         Map orderby = new LinkedHashMap();
         orderby.put("id", "asc");
         orderby.put("age", "desc");
         ResultHelp ss = test.getScrollData(new MyQueryCondition(1, 2, colums, where, queryParamsNames, queryParamsTypes, orderby));
         */
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy