Class NamedQuery

All Implemented Interfaces:
Closeable, AutoCloseable

public final class NamedQuery extends AbstractPreparedQuery<PreparedStatement,NamedQuery>
The backed PreparedStatement/CallableStatement will be closed by default after any execution methods(which will trigger the backed PreparedStatement/CallableStatement to be executed, for example: get/query/queryForInt/Long/../findFirst/findOnlyOne/list/execute/...). except the 'closeAfterExecution' flag is set to false by calling #closeAfterExecution(false).
Generally, don't cache or reuse the instance of this class, except the 'closeAfterExecution' flag is set to false by calling #closeAfterExecution(false).
The ResultSet returned by query will always be closed after execution, even 'closeAfterExecution' flag is set to false.
Remember: parameter/column index in PreparedStatement/ResultSet starts from 1, not 0.
Author:
haiyangl
See Also: