Package google.registry.beam.common
Class RegistryJpaIO
java.lang.Object
google.registry.beam.common.RegistryJpaIO
Contains IO
transforms
for a BEAM pipeline that interacts with a single
database through a JpaTransactionManager
.
The JpaTransactionManager
is instantiated once on each pipeline worker VM (through
RegistryPipelineWorkerInitializer
), made available through the static method TransactionManagerFactory.tm()
, and is shared by all threads on the VM. Configuration is through
RegistryPipelineOptions
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Atransform
that transactionally executes a JPACriteriaQuery
and adds the results to the BEAM pipeline.static class
Atransform
that writes a PCollection of entities to the SQL database using theJpaTransactionManager
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <R> RegistryJpaIO.Read
<R, R> read
(RegistryQuery.CriteriaQuerySupplier<R> query) static <R,
T> RegistryJpaIO.Read <R, T> read
(RegistryQuery.CriteriaQuerySupplier<R> query, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) static <R,
T> RegistryJpaIO.Read <R, T> read
(String sql, boolean nativeQuery, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) static <R,
T> RegistryJpaIO.Read <R, T> read
(String jpql, Class<R> clazz, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) static <R,
T> RegistryJpaIO.Read <R, T> read
(String sql, Map<String, Object> parameter, boolean nativeQuery, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) Returns aRegistryJpaIO.Read
connector based on the given native orjpql
query string.static <R,
T> RegistryJpaIO.Read <R, T> read
(String jpql, Map<String, Object> parameter, Class<R> clazz, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) Returns aRegistryJpaIO.Read
connector based on the givenjpql
typed query string.static <T> RegistryJpaIO.Write
<T> write()
-
Method Details
-
read
-
read
public static <R,T> RegistryJpaIO.Read<R,T> read(RegistryQuery.CriteriaQuerySupplier<R> query, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) -
read
public static <R,T> RegistryJpaIO.Read<R,T> read(String sql, boolean nativeQuery, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) -
read
public static <R,T> RegistryJpaIO.Read<R,T> read(String sql, @Nullable Map<String, Object> parameter, boolean nativeQuery, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) Returns aRegistryJpaIO.Read
connector based on the given native orjpql
query string.User should take care to prevent sql-injection attacks.
-
read
public static <R,T> RegistryJpaIO.Read<R,T> read(String jpql, Class<R> clazz, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) -
read
public static <R,T> RegistryJpaIO.Read<R,T> read(String jpql, @Nullable Map<String, Object> parameter, Class<R> clazz, org.apache.beam.sdk.transforms.SerializableFunction<R, T> resultMapper) Returns aRegistryJpaIO.Read
connector based on the givenjpql
typed query string.User should take care to prevent sql-injection attacks.
-
write
-