com.github.drinkjava2.jsqlbox
Interface SqlMapperGuesser

All Known Implementing Classes:
SqlMapperDefaultGuesser

public interface SqlMapperGuesser

Guess and execute the SQL for a annotated ActiveRecord entity's method

Since:
1.0.8
Author:
Yong Zhu

Method Summary
 PreparedSQL doGuessPreparedSQL(SqlBoxContext ctx, Object entity, Object... params)
           
<U> U
guess(SqlBoxContext ctx, Object entity, Object... params)
          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.
 String guessSQL(SqlBoxContext ctx, Object entity)
          Return the guessed SQL of a method which has @Sql annotation or Text in comment(need put Java in resources(class root) folder)
 

Method Detail

guess

<U> U guess(SqlBoxContext ctx,
            Object entity,
            Object... params)
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

Parameters:
entity - The ActiveRecord entity
params - The SQL params
Returns:
U The Result object, a generic type

guessSQL

String guessSQL(SqlBoxContext ctx,
                Object entity)
Return the guessed SQL of a method which has @Sql annotation or Text in comment(need put Java in resources(class root) folder)

Parameters:
entity - The ActiveRecord entity
Returns:
The SQL String

doGuessPreparedSQL

PreparedSQL doGuessPreparedSQL(SqlBoxContext ctx,
                               Object entity,
                               Object... params)
Parameters:
entity - The ActiveRecord entity
params - The Sql parameters
Returns:
The PreparedSQL instance


Copyright © 2018. All rights reserved.