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

com.silentgo.orm.rsresolver.support.CompatibleRSResolver Maven / Gradle / Ivy

There is a newer version: 0.3.2
Show newest version
package com.silentgo.orm.rsresolver.support;

import com.silentgo.orm.rsresolver.base.OneRowRSResolver;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Project : silentgo
 * com.silentgo.orm.rsresolver.support
 *
 * @author teddyzhu
 *         

* Created by teddyzhu on 16/9/21. */ public class CompatibleRSResolver implements OneRowRSResolver { private Class clz; private Integer index; private String name; public CompatibleRSResolver(Class clz, String name) { this.clz = clz; this.name = name; } public CompatibleRSResolver(Class clz, Integer index) { this.clz = clz; this.index = index; } public CompatibleRSResolver(Class clz) { this.clz = clz; this.index = 1; } @Override public T resolveRow(ResultSet resultSet) throws SQLException { return index != null ? BaseResolverKit.processColumn(resultSet, index, clz) : BaseResolverKit.processColumn(resultSet, name, clz); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy