group.rober.dataform.mapper.DataFormValidatorRowMapper Maven / Gradle / Ivy
package group.rober.dataform.mapper;
import group.rober.dataform.model.DataFormElement;
import group.rober.dataform.model.DataFormFilter;
import group.rober.dataform.model.types.ElementFilterComparePattern;
import group.rober.dataform.model.types.ElementValidatorMode;
import group.rober.dataform.model.types.ElementValidatorRunAt;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Component;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* Created by luyu on 2018/1/17.
*/
@Component
public class DataFormValidatorRowMapper implements RowMapper {
@Override
public DataFormElement.FormElementValidator mapRow(ResultSet rs, int i) throws SQLException {
DataFormElement.FormElementValidator validator = new DataFormElement.FormElementValidator ();
validator.setCode(rs.getString("CODE"));
validator.setRunAt(ElementValidatorRunAt.valueOf(rs.getString("RUN_AT")));
validator.setMode(ElementValidatorMode.valueOf(rs.getString("MODE")));
validator.setExpr(rs.getString("EXPR"));
validator.setTriggerEvent(rs.getString("TRIGGER_EVENT"));
validator.setDefaultMessage(rs.getString("MESSAGE"));
validator.setDefaultMessageI18nCode(rs.getString("MESSAGE_I18N_CODE"));
return validator;
}
}