1 package jp.sourceforge.ea2ddl.dao.allcommon.cbean.sqlclause;
\r
7 * @author DBFlute(AutoGenerator)
\r
9 public class SqlClauseH2 extends AbstractSqlClause {
\r
11 /** String of fetch-scope as sql-suffix. */
\r
12 protected String _fetchScopeSqlSuffix = "";
\r
14 /** String of lock as sql-suffix. */
\r
15 protected String _lockSqlSuffix = "";
\r
19 * @param tableName Table name. (NotNull)
\r
21 public SqlClauseH2(String tableName) {
\r
26 * The implementation.
\r
28 protected void doFetchFirst() {
\r
33 * The implementation.
\r
35 protected void doFetchPage() {
\r
36 _fetchScopeSqlSuffix = " limit " + getFetchSize() + " offset " + getPageStartIndex();
\r
40 * The implementation.
\r
42 protected void doClearFetchPageClause() {
\r
43 _fetchScopeSqlSuffix = "";
\r
47 * The implementation.
\r
48 * @return this. (NotNull)
\r
50 public SqlClause lockForUpdate() {
\r
51 _lockSqlSuffix = " for update";
\r
56 * The implementation.
\r
57 * @return Select-hint. (NotNull)
\r
59 protected String createSelectHint() {
\r
64 * The implementation.
\r
65 * @return From-base-table-hint. {select * from table [from-base-table-hint] where ...} (NotNull)
\r
67 protected String createFromBaseTableHint() {
\r
72 * The implementation.
\r
73 * @return From-hint. (NotNull)
\r
75 protected String createFromHint() {
\r
80 * The implementation.
\r
81 * @return Sql-suffix. (NotNull)
\r
83 protected String createSqlSuffix() {
\r
84 return _fetchScopeSqlSuffix + _lockSqlSuffix;
\r
88 // ===================================================================================
\r
89 // Unique Constraint Override
\r
90 // ==========================
\r
92 public boolean isUniqueConstraintException(String sqlState, Integer errorCode) {
\r
93 return "23001".equals(sqlState);
\r