user1228785
user1228785

Reputation: 542

Datastax 4.6 Java driver Object mapper async/batch query

Datastax java driver 4.6 version I dont see support in object mapper for Batch/async queries

Is there any workaround for it? Any reason why objectmapper has no batch/async support?

Previous version there was MappingManager using which batch and async queries were suppported

Upvotes: 2

Views: 511

Answers (1)

Alex Ott
Alex Ott

Reputation: 87299

Everything is regulated by return type of declared function:

  • For async versions, look for documentation for specific annotation, for example, @Insert, or @Select, etc.. But in all cases it's regulated by the return type of the declared function. To get async version you need to declare function with CompletionStage<SomeClass> or CompletableFuture<SomeClass> return type
  • Batching is similar - you declare function with BoundStatement return type, and put that bound statement into batch that is executed via session.execute, or session.executeAsync.

Upvotes: 2

Related Questions