Package com.lingbobu.flashdb.transfer.sqlfunc

Source Code of com.lingbobu.flashdb.transfer.sqlfunc.DbQueryIN

package com.lingbobu.flashdb.transfer.sqlfunc;

import javax.sql.DataSource;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

import com.lingbobu.flashdb.transfer.TransferInput;
import com.lingbobu.flashdb.transfer.impl.InputDbQueryIN;

/**
* IN ? 形式的数据库查询. 用于支持增量获取数据
*/
public class DbQueryIN implements BeanFactoryAware {
  private BeanFactory beanFactory;

  @Override
  public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
    this.beanFactory = beanFactory;
  }
 
  public TransferInput call(String dataSourceBean, String dataSourceSql, Object inValues) {
    DataSource dataSource = beanFactory.getBean(dataSourceBean, DataSource.class);
    return new InputDbQueryIN(dataSource, dataSourceSql, inValues);
  }
}
TOP

Related Classes of com.lingbobu.flashdb.transfer.sqlfunc.DbQueryIN

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.