001package com.randomnoun.common.spring; 002 003import org.springframework.jdbc.core.RowMapper; 004 005/** A SelectFromRowMapper is pretty much the same as a RowMapper, except 006 * it knows what columns and tables to query (i.e. the 'SELECT' and 'FROM' clauses of the SQL), 007 * so the caller only needs to supply WHERE and ORDER BY SQL clauses 008 * 009 * @author knoxg 010 */ 011public interface SelectFromRowMapper<T> extends RowMapper<T> { 012 013 // cte can be used to set up common table expressions ('WITH' statements) before the SELECT 014 015 default public String getCte() { return null; } 016 017 public String getSelect(); 018 019 public String getFrom(); 020 021 // this might be a good place to add pagination constraints as well, once we add that to the API 022 023}