Package oracle.pgx.api.subgraph
Class PreparedPgSqlPgqlQuery
- java.lang.Object
-
- oracle.pgx.api.subgraph.AbstractSubgraphReader<R>
-
- oracle.pgx.api.subgraph.PgqlBasedSubgraphReader<R,P>
-
- oracle.pgx.api.subgraph.PreparedPgSqlPgqlQuery
-
- All Implemented Interfaces:
oracle.pgx.api.subgraph.internal.PreparedQueryBuilder<PreparedPgSqlPgqlQuery>
,PreparedPgqlQueryBuilder<PreparedPgSqlPgqlQuery>
public class PreparedPgSqlPgqlQuery extends PgqlBasedSubgraphReader<R,P> implements PreparedPgqlQueryBuilder<PreparedPgSqlPgqlQuery>
A configuration builder for initial subgraph reading using a prepared PGQL query. Use this class to provide all the required arguments for the query or to continue configuring the read operation.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
connections(int numConnections)
sets the number of connections to open to load the data in parallelR
dataSourceId(java.lang.String dataSourceId)
sets the dataSourceId to which to connectR
jdbcUrl(java.lang.String jdbcUrl)
sets the jdbcUrl to use for connecting to the DBR
keystoreAlias(java.lang.String keystoreAlias)
sets the keystore alias to retrieve the password from the keystorePgxGraph
load(java.lang.String graphName)
Blocking version ofAbstractSubgraphReader.loadAsync(String)
.PgxFuture<PgxGraph>
loadAsync()
Load the subgraph.PgxFuture<PgxGraph>
loadAsync(java.lang.String graphName)
Load the subgraph.R
owner(java.lang.String owner)
R
password(java.lang.String password)
sets the password to use for connecting to the databaseP
preparedPgqlQuery(java.lang.String query)
Adds a prepared query to list of queries that will be executed to load the subgraph.R
queryPgql(java.lang.String query)
Adds another filtering query to the list of queries that will be executed to load the subgraph.R
schema(java.lang.String schema)
R
username(java.lang.String userName)
sets the username of the DB user to use to connect to the DBPreparedPgSqlPgqlQuery
withArg(int position, QueryArgumentType type, java.lang.Object value)
R
withConfig(PartitionedGraphConfig config)
sets the graph configuration to use for loading the subgraph.-
Methods inherited from class oracle.pgx.api.subgraph.AbstractSubgraphReader
load
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface oracle.pgx.api.subgraph.PreparedPgqlQueryBuilder
withBooleanArg, withDateArg, withDoubleArg, withFloatArg, withIntegerArg, withLongArg, withStringArg, withTimeArg, withTimestampArg, withTimestampWithTimezoneArg, withTimeWithTimezoneArg
-
-
-
-
Method Detail
-
withArg
public PreparedPgSqlPgqlQuery withArg(int position, QueryArgumentType type, java.lang.Object value)
- Specified by:
withArg
in interfaceoracle.pgx.api.subgraph.internal.PreparedQueryBuilder<PreparedPgSqlPgqlQuery>
-
load
public PgxGraph load(java.lang.String graphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Description copied from class:AbstractSubgraphReader
Blocking version ofAbstractSubgraphReader.loadAsync(String)
. Starts the reading operation and awaits its completion.- Overrides:
load
in classAbstractSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>>
- Parameters:
graphName
- the graph name- Returns:
- The loaded subgraph.
- Throws:
java.util.concurrent.ExecutionException
- When the operation failed.java.lang.InterruptedException
- When the asynchronous operation is interrupted.
-
withConfig
public R withConfig(PartitionedGraphConfig config)
Description copied from class:PgqlBasedSubgraphReader
sets the graph configuration to use for loading the subgraph. It has to correspond to a graph configuration for a graph that comes from a PG view.- Overrides:
withConfig
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
config
- the configuration of the graph to load- Returns:
- this loader
-
dataSourceId
public R dataSourceId(java.lang.String dataSourceId)
Description copied from class:PgqlBasedSubgraphReader
sets the dataSourceId to which to connect- Overrides:
dataSourceId
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
dataSourceId
- the datasourceId- Returns:
- this loader
-
jdbcUrl
public R jdbcUrl(java.lang.String jdbcUrl)
Description copied from class:PgqlBasedSubgraphReader
sets the jdbcUrl to use for connecting to the DB- Overrides:
jdbcUrl
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
jdbcUrl
- the jdbc url- Returns:
- this loader
-
username
public R username(java.lang.String userName)
Description copied from class:PgqlBasedSubgraphReader
sets the username of the DB user to use to connect to the DB- Overrides:
username
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
userName
- the username- Returns:
- this loader
-
keystoreAlias
public R keystoreAlias(java.lang.String keystoreAlias)
Description copied from class:PgqlBasedSubgraphReader
sets the keystore alias to retrieve the password from the keystore- Overrides:
keystoreAlias
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
keystoreAlias
- the keystore alias- Returns:
- this loader
-
password
public R password(java.lang.String password)
Description copied from class:PgqlBasedSubgraphReader
sets the password to use for connecting to the database- Overrides:
password
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
password
- the password- Returns:
- this loader
-
schema
public R schema(java.lang.String schema)
-
owner
public R owner(java.lang.String owner)
-
connections
public R connections(int numConnections)
Description copied from class:PgqlBasedSubgraphReader
sets the number of connections to open to load the data in parallel- Overrides:
connections
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
numConnections
- the number of connections- Returns:
- this loader
-
queryPgql
public R queryPgql(java.lang.String query)
Description copied from class:PgqlBasedSubgraphReader
Adds another filtering query to the list of queries that will be executed to load the subgraph. The query has to be starting at the first MATCH pattern (e.g. MATCH (u)-[e]->(v) WHERE ...).- Overrides:
queryPgql
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
query
- the PGQL query to use for filtering- Returns:
- this loader
-
loadAsync
public PgxFuture<PgxGraph> loadAsync(java.lang.String graphName)
Description copied from class:AbstractSubgraphReader
Load the subgraph.- Overrides:
loadAsync
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
graphName
- the name of the graph- Returns:
- The subgraph.
-
loadAsync
public PgxFuture<PgxGraph> loadAsync()
Description copied from class:AbstractSubgraphReader
Load the subgraph.- Overrides:
loadAsync
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Returns:
- The subgraph.
-
preparedPgqlQuery
public P preparedPgqlQuery(java.lang.String query)
Description copied from class:PgqlBasedSubgraphReader
Adds a prepared query to list of queries that will be executed to load the subgraph. The query has to also start with aMATCH
clause. This returns a builder which can be used to specify arguments for the prepared query. All the arguments must be provided before the reading operation is triggered.- Specified by:
preparedPgqlQuery
in classPgqlBasedSubgraphReader<R extends PgqlBasedSubgraphReader<R,P>,P extends PgqlBasedSubgraphReader<R,P> & PreparedPgqlQueryBuilder<P>>
- Parameters:
query
- The PGQL query.- Returns:
- A builder used for providing arguments of the prepared query.
-
-