com.github.drinkjava2.jsqlbox
Class SqlMapperDefaultGuesser
java.lang.Object
com.github.drinkjava2.jsqlbox.SqlMapperDefaultGuesser
- All Implemented Interfaces:
- SqlMapperGuesser
public class SqlMapperDefaultGuesser
- extends Object
- implements SqlMapperGuesser
Guess and execute the SQL for a annotated ActiveRecord entity's method
- Since:
- 1.0.8
- Author:
- Yong Zhu
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
instance
public static final SqlMapperGuesser instance
SqlMapperDefaultGuesser
public SqlMapperDefaultGuesser()
guess
public <T> T guess(SqlBoxContext ctx,
Object entity,
Object... params)
- Description copied from interface:
SqlMapperGuesser
- Execute operation to access database, based on current method @Sql annotated
String or Text String and parameters, guess a best fit
query/update/delete/execute method to run. SubClass can override this method
to do different guess logic
- Specified by:
guess in interface SqlMapperGuesser
entity - The ActiveRecord entityparams - The SQL params
- Returns:
- U The Result object, a generic type
guessSQL
public String guessSQL(SqlBoxContext ctx,
Object ac)
- Description copied from interface:
SqlMapperGuesser
- Return the guessed SQL of a method which has @Sql annotation or Text in
comment(need put Java in resources(class root) folder)
- Specified by:
guessSQL in interface SqlMapperGuesser
ac - The ActiveRecord entity
- Returns:
- The SQL String
doGuessPreparedSQL
public PreparedSQL doGuessPreparedSQL(SqlBoxContext ctx,
Object ac,
Object... params)
- Specified by:
doGuessPreparedSQL in interface SqlMapperGuesser
ac - The ActiveRecord entityparams - The Sql parameters
- Returns:
- The PreparedSQL instance
Copyright © 2018. All rights reserved.