Package org.nutz.dao.impl.sql.pojo

Source Code of org.nutz.dao.impl.sql.pojo.PojoQueryEntityCallback

package org.nutz.dao.impl.sql.pojo;

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

import org.nutz.dao.pager.ResultSetLooping;
import org.nutz.dao.sql.Pojo;
import org.nutz.dao.sql.PojoCallback;
import org.nutz.dao.sql.SqlContext;

public class PojoQueryEntityCallback implements PojoCallback {

  public Object invoke(Connection conn, ResultSet rs, final Pojo pojo) throws SQLException {
    return new ResultSetLooping() {
      protected Object createObject(ResultSet rs, SqlContext context) {
        return pojo.getEntity().getObject(rs, context.getFieldMatcher());
      }
    }.doLoop(rs, pojo.getContext());
  }

}
TOP

Related Classes of org.nutz.dao.impl.sql.pojo.PojoQueryEntityCallback

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.