|
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 HeavyAIEscapeFunctions.java.
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.appendCall |
( |
StringBuilder |
sb, |
|
|
String |
begin, |
|
|
String |
separator, |
|
|
String |
end, |
|
|
List<?extends CharSequence > |
args |
|
) |
| |
|
inlinestatic |
static ConcurrentMap<String, Method> ai.heavy.jdbc.HeavyAIEscapeFunctions.createFunctionMap |
( |
String |
prefix | ) |
|
|
inlinestaticprivate |
Definition at line 17 of file HeavyAIEscapeFunctions.java.
References substring().
18 Method[] methods = HeavyAIEscapeFunctions.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 ai.heavy.jdbc.HeavyAIEscapeFunctions.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 HeavyAIEscapeFunctions.java.
References ai.heavy.jdbc.HeavyAIEscapeFunctions.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 ai.heavy.jdbc.HeavyAIEscapeFunctions.singleArgumentFunctionCall |
( |
StringBuilder |
buf, |
|
|
String |
call, |
|
|
String |
functionName, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| |
|
inlinestaticprivate |
Definition at line 197 of file HeavyAIEscapeFunctions.java.
References File_Namespace.append().
Referenced by ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlceiling(), ai.heavy.jdbc.HeavyAIEscapeFunctions.sqldayofmonth(), ai.heavy.jdbc.HeavyAIEscapeFunctions.sqldayofyear(), ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlhour(), ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlminute(), ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlmonth(), ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlquarter(), ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlsecond(), ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlweek(), and ai.heavy.jdbc.HeavyAIEscapeFunctions.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, const int8_t *buf)
Appends the specified number of bytes to the end of the file f from buf.
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlceiling |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqldayofmonth |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.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 HeavyAIEscapeFunctions.java.
References ai.heavy.jdbc.HeavyAIEscapeFunctions.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 ai.heavy.jdbc.HeavyAIEscapeFunctions.sqldayofyear |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlhour |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlminute |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlmonth |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlquarter |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlsecond |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlweek |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
static void ai.heavy.jdbc.HeavyAIEscapeFunctions.sqlyear |
( |
StringBuilder |
buf, |
|
|
List<?extends CharSequence > |
parsedArgs |
|
) |
| throws SQLException |
|
inlinestatic |
final ConcurrentMap<String, Method> ai.heavy.jdbc.HeavyAIEscapeFunctions.FUNCTION_MAP |
|
staticprivate |
The documentation for this class was generated from the following file: