|
static Method | getFunction (String functionName) |
|
static void | sqlceiling (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqldayofmonth (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqldayofweek (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqldayofyear (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqlhour (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqlminute (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqlmonth (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqlquarter (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqlsecond (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqlweek (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | sqlyear (StringBuilder buf, List<?extends CharSequence > parsedArgs) throws SQLException |
|
static void | appendCall (StringBuilder sb, String begin, String separator, String end, List<?extends CharSequence > args) |
|
Definition at line 10 of file OmniSciEscapeFunctions.java.
static void com.omnisci.jdbc.OmniSciEscapeFunctions.appendCall |
( |
StringBuilder |
sb, |
|
|
String |
begin, |
|
|
String |
separator, |
|
|
String |
end, |
|
|
List<?extends CharSequence > |
args |
|
) |
| |
|
inlinestatic |
Appends
begin arg0 separator arg1 separator end
sequence to the input StringBuilder
- Parameters
-
sb | destination StringBuilder |
begin | begin string |
separator | separator string |
end | end string |
args | arguments |
Definition at line 220 of file OmniSciEscapeFunctions.java.
References i.
Referenced by com.omnisci.jdbc.OmniSciEscapeFunctions.sqldayofweek().
225 int size = begin.length();
231 int numberOfArguments = args.size();
232 for (
int i = 0;
i < numberOfArguments;
i++) {
233 size += args.get(
i).length();
235 size += separator.length() * (numberOfArguments - 1);
236 sb.ensureCapacity(sb.length() + size + 1);
238 for (
int i = 0;
i < numberOfArguments;
i++) {
240 sb.append(separator);
242 sb.append(args.get(
i));
static ConcurrentMap<String, Method> com.omnisci.jdbc.OmniSciEscapeFunctions.createFunctionMap |
( |
String |
prefix | ) |
|
|
inlinestaticprivate |
Definition at line 17 of file OmniSciEscapeFunctions.java.
18 Method[] methods = OmniSciEscapeFunctions.class.getMethods();
19 ConcurrentMap<String, Method> functionMap =
20 new ConcurrentHashMap<String, Method>(methods.length * 2);
21 for (Method method : methods) {
22 if (method.getName().startsWith(prefix)) {
24 method.getName().substring(prefix.length()).toLowerCase(Locale.US),
static Method com.omnisci.jdbc.OmniSciEscapeFunctions.getFunction |
( |
String |
functionName | ) |
|
|
inlinestatic |
get Method object implementing the given function
- Parameters
-
functionName | name of the searched function |
- Returns
- a Method object or null if not found
Definition at line 37 of file OmniSciEscapeFunctions.java.
References com.omnisci.jdbc.OmniSciEscapeFunctions.FUNCTION_MAP.
38 Method method = FUNCTION_MAP.get(functionName);
43 String nameLower = functionName.toLowerCase(Locale.US);
44 if (nameLower.equals(functionName)) {
48 method = FUNCTION_MAP.get(nameLower);
53 FUNCTION_MAP.putIfAbsent(functionName, method);
static final ConcurrentMap< String, Method > FUNCTION_MAP
static void com.omnisci.jdbc.OmniSciEscapeFunctions.singleArgumentFunctionCall |
( |
StringBuilder |
buf, |
|
|
String |
call, |
|
|
String |
functionName, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| |
|
inlinestaticprivate |
Definition at line 197 of file OmniSciEscapeFunctions.java.
References File_Namespace.append().
Referenced by com.omnisci.jdbc.OmniSciEscapeFunctions.sqlceiling(), com.omnisci.jdbc.OmniSciEscapeFunctions.sqldayofmonth(), com.omnisci.jdbc.OmniSciEscapeFunctions.sqldayofyear(), com.omnisci.jdbc.OmniSciEscapeFunctions.sqlhour(), com.omnisci.jdbc.OmniSciEscapeFunctions.sqlminute(), com.omnisci.jdbc.OmniSciEscapeFunctions.sqlmonth(), com.omnisci.jdbc.OmniSciEscapeFunctions.sqlquarter(), com.omnisci.jdbc.OmniSciEscapeFunctions.sqlsecond(), com.omnisci.jdbc.OmniSciEscapeFunctions.sqlweek(), and com.omnisci.jdbc.OmniSciEscapeFunctions.sqlyear().
201 if (parsedArgs.size() != 1) {
202 throw new RuntimeException(
203 "Syntax error " + functionName +
" takes one and only one argument.");
205 CharSequence arg0 = parsedArgs.get(0);
206 buf.ensureCapacity(buf.length() + call.length() + arg0.length() + 1);
207 buf.append(call).
append(arg0).append(
')');
size_t append(FILE *f, const size_t size, int8_t *buf)
Appends the specified number of bytes to the end of the file f from buf.
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqlceiling |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqldayofmonth |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqldayofweek |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
dayofweek translation adding 1 to postgresql function since we expect values from 1 to 7
- Parameters
-
buf | The buffer to append into |
parsedArgs | arguments |
- Exceptions
-
SQLException | if something wrong happens |
Definition at line 92 of file OmniSciEscapeFunctions.java.
References com.omnisci.jdbc.OmniSciEscapeFunctions.appendCall().
94 if (parsedArgs.size() != 1) {
95 throw new RuntimeException(
96 "Syntax error function 'dayofweek' takes one and only one argument.");
98 appendCall(buf,
"extract(dow from ",
",",
")+1", parsedArgs);
static void appendCall(StringBuilder sb, String begin, String separator, String end, List<?extends CharSequence > args)
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqldayofyear |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqlhour |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqlminute |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqlmonth |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqlquarter |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqlsecond |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqlweek |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void com.omnisci.jdbc.OmniSciEscapeFunctions.sqlyear |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
final ConcurrentMap<String, Method> com.omnisci.jdbc.OmniSciEscapeFunctions.FUNCTION_MAP |
|
staticprivate |
The documentation for this class was generated from the following file: