Class Command (0.27.1)
Stay organized with collections
Save and categorize content based on your preferences.
publicabstractclass CommandThis abstract class concerns itself with representing a method of matching a specific statement and translating it to a form that Spanner understands. The user should call is() to determine whether it matches before trying to translate.
Inherited Members
Static Methods
getCommands(String sql, Connection connection, JSONObject commandMetadataJSON)
publicstaticList<Command>getCommands(Stringsql,Connectionconnection,JSONObjectcommandMetadataJSON)The list of all subcommands to this command. When subclassing this, make sure to add the new command to the below list, if applicable (i.e.: if you want it to be run). Commands may also be specified via Dynamic Commands, which are defined from an input JSON file. These commands precede the hard-coded ones in execution.
| Parameters | |
|---|---|
| Name | Description |
sql |
String The SQL command to be translated. |
connection |
Connection The connection currently in use. |
commandMetadataJSON |
org.json.simple.JSONObject |
| Returns | |
|---|---|
| Type | Description |
List<Command> |
A list of all Command subclasses. |
Fields
matcher
protectedMatchermatcher| Field Value | |
|---|---|
| Type | Description |
Matcher |
|
sql
protectedStringsql| Field Value | |
|---|---|
| Type | Description |
String |
|
Methods
getPattern()
protectedabstractPatterngetPattern()The pattern expected by this command: is() will only return true if it matches this pattern.
| Returns | |
|---|---|
| Type | Description |
Pattern |
The pattern apposite (in relation to) the command. |
is()
publicbooleanis()| Returns | |
|---|---|
| Type | Description |
boolean |
True if the SQL statement matches the pattern. |
translate()
publicabstractStringtranslate()| Returns | |
|---|---|
| Type | Description |
String |
The equivalent Spanner statement for the specified SQL statement. |