Search code examples
javacassandradriverdatastax-java-driver

Best way to convert Cassandra ResultSet to java objects in OSS driver


We are in the process of migrating from Cassandra DSE to OSS driver and the pain point is converting the result set into a list of Java objects. I don't want to use Mapper annotation, like detailed here

So what is the most efficient way to convert ResultSet into list of java objects? Any suggestion highly appreciated


Solution

  • If you don't want to use Mapper then just need to write converting function that will take Row, extract all necessary columns, and return POJO constructed from teh extracted data... I don't see other ways, except writing an adhoc version of object mapper that would use the reflection to match POJO's field names with the column names