Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2014-2015 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  * either express or implied. See the License for the specific language
  * governing permissions and limitations under the License.
  */
 package org.dbflute.dbway;
 
 import java.util.List;

The interface of DB-way.

Author(s):
jflute
 
 public interface DBWay {
 
     // ===================================================================================
     //                                                                        Sequence Way
     //                                                                        ============
     
Build the SQL for next value of sequence with a sequence name.

Parameters:
sequenceName The sequence name. (NotNull)
Returns:
The SQL for next value of sequence. (NullAllowed: if sequence is unsupported)
 
     String buildSequenceNextValSql(String sequenceName);
 
     // ===================================================================================
     //                                                                        Identity Way
     //                                                                        ============
     
Get the SQL for getting inserted value of identity.

Returns:
The SQL for getting inserted value of sequence. (NullAllowed: If it does not have identity, returns null.)
 
 
     // ===================================================================================
     //                                                                         SQL Support
     //                                                                         ===========
     boolean isBlockCommentSupported();
 
     boolean isLineCommentSupported();
 
     // ===================================================================================
     //                                                                        JDBC Support
     //                                                                        ============
     boolean isScrollableCursorSupported();
 
     // ===================================================================================
     //                                                                 LikeSearch WildCard
     //                                                                 ===================
 
     // ===================================================================================
     //                                                                    String Connector
     //                                                                    ================
 
         public String connect(Object... elements) {
             final StringBuilder sb = new StringBuilder();
             int index = 0;
             for (Object element : elements) {
                 if (index > 0) {
                     sb.append(" || ");
                 }
                 sb.append(element);
                 ++index;
             }
             return sb.toString();
         }
     };
 
         public String connect(Object... elements) {
             final StringBuilder sb = new StringBuilder();
             int index = 0;
             for (Object element : elements) {
                 if (index > 0) {
                     sb.append(" + ");
                 }
                 sb.append(element);
                 ++index;
             }
             return sb.toString();
         }
     };
 
     // ===================================================================================
     //                                                                   SQLException Info
     //                                                                   =================
    
Is the SQLException from unique constraint? {Use both SQLState and ErrorCode}

Parameters:
sqlState SQLState of the SQLException. (NullAllowed)
errorCode ErrorCode of the SQLException. (NullAllowed)
Returns:
Is the SQLException from unique constraint?
    boolean isUniqueConstraintException(String sqlStateInteger errorCode);
New to GrepCode? Check out our FAQ X