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

com.blade.jdbc.core.QueryMeta Maven / Gradle / Ivy

There is a newer version: 0.2.2-RELEASE
Show newest version
package com.blade.jdbc.core;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

/**
 * @author biezhi
 * @date 2017/7/25
 */
@Data
@NoArgsConstructor
public class QueryMeta {

    private String              sql;
    private Object[]            params;
    private Map columnMapping;

    public QueryMeta(String sql, Object[] params) {
        this.sql = sql;
        this.params = params;
    }

    public void addColumnMapping(String columnName, String fieldName) {
        if (null == columnMapping) {
            columnMapping = new HashMap<>(8);
        }
        columnMapping.put(columnName, fieldName);
    }

    public boolean hasColumnMapping() {
        return null != columnMapping && !columnMapping.isEmpty();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy