com.github.drinkjava2.jdbpro
Enum SqlOption

java.lang.Object
  extended by java.lang.Enum<SqlOption>
      extended by com.github.drinkjava2.jdbpro.SqlOption
All Implemented Interfaces:
Serializable, Comparable<SqlOption>

public enum SqlOption
extends Enum<SqlOption>

SqlOption system how to explain a SqlItem, SqlItem like "Message" in windows, SqlOption is the "Message" type.

Since:
1.7.0.3
Author:
Yong Zhu

Enum Constant Summary
ALIAS
          Mark alias names for TableModels
AUTO_SQL
          This option is designed for ORM, will be parsed as a left join SQL
BIND
          BIND Key-Values pairs "key1,value1, key2,value2..." for SqlTemplateEngine
DISABLE_HANDLERS
          Disable handles according given handlers' class
ENABLE_HANDLERS
          Disable handles according given handlers' class
EXECUTE
          It's a EXECUTE type SQL
GIVE
          GIVE, GIVE_BOTH option are designed for ORM query
GIVE_BOTH
           
IGNORE_NULL
          This option is designed for ORM insert and update CURD method, mark a "IGNORE_NULL" item"
INSERT
          It's a INSERT type SQL
IOC
          Give one or more class as parameter, instance will created by IocTool
NOT_NULL
          Usage: NOT_NUL("user_name=?", name), when name is null, nothing will be appended into SQL and parameters, otherwise return a "user_name=?" String and a SQL parameter
OTHER
          OTHER type SqlItem used to store some other items
PARAM
          Append a parameter or parameter array
QUERY
          It's a QUERY type SQL
QUESTION_PARAM
          Append a "?" String and append a parameter or parameter array
SHARD_DATABASE
          Tell system this is a "SHARD_DATABASE" item
SHARD_TABLE
          Tell system this is a "SHARD_TABLE" item
SQL
          Append a SQL String piece
SWITCHTO
          Switch to another DbPro or subClass (SqlBoxContext) to execute SQL
UPDATE
          It's a UPDATE type SQL
USE_AUTO
          Tell system to choose master or slave database automatically (write:master, read:if in Transaction use master otherwise use one slave)
USE_BOTH
          Tell system force use master and slave database (write: master + all slaves, read: master)
USE_MASTER
          Tell system force use master database (write and read:master )
USE_SLAVE
          Tell system force use slave database (write:all slaves, read:one slave)
USE_TEMPLATE
          Force use template style
VALUES_QUESTIONS
          Append a " values(?,?,?....?)" String at end of SQL
 
Method Summary
static SqlOption valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SqlOption[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SQL

public static final SqlOption SQL
Append a SQL String piece


PARAM

public static final SqlOption PARAM
Append a parameter or parameter array


QUESTION_PARAM

public static final SqlOption QUESTION_PARAM
Append a "?" String and append a parameter or parameter array


BIND

public static final SqlOption BIND
BIND Key-Values pairs "key1,value1, key2,value2..." for SqlTemplateEngine


NOT_NULL

public static final SqlOption NOT_NULL
Usage: NOT_NUL("user_name=?", name), when name is null, nothing will be appended into SQL and parameters, otherwise return a "user_name=?" String and a SQL parameter


VALUES_QUESTIONS

public static final SqlOption VALUES_QUESTIONS
Append a " values(?,?,?....?)" String at end of SQL


SWITCHTO

public static final SqlOption SWITCHTO
Switch to another DbPro or subClass (SqlBoxContext) to execute SQL


IOC

public static final SqlOption IOC
Give one or more class as parameter, instance will created by IocTool


DISABLE_HANDLERS

public static final SqlOption DISABLE_HANDLERS
Disable handles according given handlers' class


ENABLE_HANDLERS

public static final SqlOption ENABLE_HANDLERS
Disable handles according given handlers' class


USE_TEMPLATE

public static final SqlOption USE_TEMPLATE
Force use template style


EXECUTE

public static final SqlOption EXECUTE
It's a EXECUTE type SQL


UPDATE

public static final SqlOption UPDATE
It's a UPDATE type SQL


INSERT

public static final SqlOption INSERT
It's a INSERT type SQL


QUERY

public static final SqlOption QUERY
It's a QUERY type SQL


OTHER

public static final SqlOption OTHER
OTHER type SqlItem used to store some other items


USE_AUTO

public static final SqlOption USE_AUTO
Tell system to choose master or slave database automatically (write:master, read:if in Transaction use master otherwise use one slave)


USE_MASTER

public static final SqlOption USE_MASTER
Tell system force use master database (write and read:master )


USE_SLAVE

public static final SqlOption USE_SLAVE
Tell system force use slave database (write:all slaves, read:one slave)


USE_BOTH

public static final SqlOption USE_BOTH
Tell system force use master and slave database (write: master + all slaves, read: master)


ALIAS

public static final SqlOption ALIAS
Mark alias names for TableModels


SHARD_TABLE

public static final SqlOption SHARD_TABLE
Tell system this is a "SHARD_TABLE" item


SHARD_DATABASE

public static final SqlOption SHARD_DATABASE
Tell system this is a "SHARD_DATABASE" item


GIVE

public static final SqlOption GIVE
GIVE, GIVE_BOTH option are designed for ORM query


GIVE_BOTH

public static final SqlOption GIVE_BOTH

IGNORE_NULL

public static final SqlOption IGNORE_NULL
This option is designed for ORM insert and update CURD method, mark a "IGNORE_NULL" item"


AUTO_SQL

public static final SqlOption AUTO_SQL
This option is designed for ORM, will be parsed as a left join SQL

Method Detail

values

public static SqlOption[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SqlOption c : SqlOption.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SqlOption valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2018. All rights reserved.