| Modifier and Type | Field and Description |
|---|---|
static String |
DATE_ARG |
static String |
FROM_ARG |
static String |
ID_ARG |
static String |
LIMIT_ARG |
static org.slf4j.Logger |
LOG |
static String |
MAX_LAT |
static String |
MAX_LON |
static String |
MIN_LAT |
static String |
MIN_LON |
static String |
OFFSET_ARG |
static String |
SEARCH_ARG |
String |
tableName |
static String |
TO_ARG |
| Constructor and Description |
|---|
JDBCFetcher(String tableName)
Constructor for tables that need neither restriction by a where clause nor sorting based on the enclosing entity.
|
JDBCFetcher(String tableName,
String parentJoinField) |
JDBCFetcher(String tableName,
String parentJoinField,
String sortField,
boolean autoLimit) |
JDBCFetcher(String tableName,
String parentJoinField,
String sortField,
boolean autoLimit,
String childJoinField) |
| Modifier and Type | Method and Description |
|---|---|
static graphql.schema.GraphQLFieldDefinition |
field(String tableName) |
List<Map<String,Object>> |
get(graphql.schema.DataFetchingEnvironment environment) |
static void |
validateNamespace(String namespace)
Checks that the namespace argument is clean and meets the SQL schema specifications.
|
public static final org.slf4j.Logger LOG
public static final String ID_ARG
public static final String LIMIT_ARG
public static final String OFFSET_ARG
public static final String SEARCH_ARG
public static final String DATE_ARG
public static final String FROM_ARG
public static final String TO_ARG
public static final String MIN_LAT
public static final String MIN_LON
public static final String MAX_LAT
public static final String MAX_LON
public final String tableName
public JDBCFetcher(String tableName)
public JDBCFetcher(String tableName, String parentJoinField)
tableName - the database table from which to fetch rows.parentJoinField - The field in the enclosing level of the Graphql query to use in a where clause.
This allows e.g. selecting all the stop_times within a trip, using the enclosing trip's trip_id.
If null, no such clause is added.public JDBCFetcher(String tableName, String parentJoinField, String sortField, boolean autoLimit)
sortField - The field on which to sort the list or fetched rows (in ascending order only).
If null, no sort is included.autoLimit - Whether to by default apply a limit to the fetched rows. This is used for certain
tables that it is unnatural to expect a limit (e.g., shape points or pattern stops).public JDBCFetcher(String tableName, String parentJoinField, String sortField, boolean autoLimit, String childJoinField)
childJoinField - The child table field that should be joined to the parent join field. This enables joining
where references from the child table to the parent table do not share the same field name,
e.g., stops#stop_id -> transfers#from_stop_id. This value defaults to parentJoinField if
argument is null.public static graphql.schema.GraphQLFieldDefinition field(String tableName)
public static void validateNamespace(String namespace)
namespace - database schema namespace/table prefixCopyright © 2019. All rights reserved.