Accessing underlying session from CassandraSession


(Adarsh Singh) #1

I Am trying to use Object Mapper https://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/using/ to avoid the boilerplate code and to manage cassandra entities.
The Mapper needs a session object, the CassandraSession provided by lagom gives the access to underlying session object but as a CompletionStage[Session].
Question is why is it async to get session object. Is there a better way?
Am currently accessing this way manager = new MappingManager(session.underlying().toCompletableFuture().get());
which I know is very bad approach.
Can you pls help me on this? Thanks in advance