@UseST4StatementLocator public interface Dao { @SqlUpdate void createSomethingTable(); @SqlUpdate int insertSomething(int id, String name); @SqlQuery @MapResultAsBean Something findById(int id, @Define("columns") String... columns); @SqlQuery("select concat('Hello, ', name, '!') from something where id = :0") String findGreetingFor(int id); } }
@UseST4StatementLocator public interface InnerDao { @SqlUpdate void createSomething(); @SqlUpdate void insert(@Define("table") String table, @Bind("id") int id, @Bind("name") String name); @SqlQuery @MapResultAsBean Something findById(@Bind("id") int id); @SqlQuery("select name from something where id = :id") String findNameById(@Bind("id") int id); }
@UseST4StatementLocator public interface OuterDao { @SqlUpdate void createSomething2(); @SqlUpdate void insert2(@Define("table") String table, @Bind("id") int id, @Bind("name") String name); @SqlQuery @MapResultAsBean Something findById2(@Bind("id") int id); }
@SqlUpdate @UseST4StatementLocator public void insertVivek(); }