DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

amit535_97416 avatar image
amit535_97416 asked ·

InventoryMapperBuilder class not available in the tarball installation for Datastax java driver spring boot starter?

The tarball which I downloaded from the datastax lab does not have InventoryMapperBuilder code.

spring-boot
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi @amit535_97416,

the InventoryMapperBuilder class is generated code based on your annotations.

The java-driver-mapper-processor artifact contains the annotation processor. It hooks into the Java compiler, and generates additional source files from your annotated classes before the main compilation happens.

Have a look at the driver documentation here:

https://docs.datastax.com/en/developer/java-driver/4.8/manual/mapper/config/

and

https://docs.datastax.com/en/developer/java-driver/4.8/manual/mapper/mapper/

You would need to generate the class first.


Also a note re the lab release of the Datastax java driver spring boot starter. As far as I know it is no longer developed.

The recommendation is now to go with Spring Data Cassandra.

https://docs.spring.io/spring-data/cassandra/docs/current/reference/html/#reference

For an example using the Mapper, check out the Cassandra Workshop Series, week 4, Getting Started with Astra Java:

https://github.com/DataStax-Academy/cassandra-workshop-series/tree/master/week4-AppDev-api/getting-started-with-astra-java

I hope this helps!

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks Bettina, I was using eclipse and running the program as Spring boot application, the class was not getting generated.

When I built using Maven it got generated.

As suggested above, I generally use spring data Cassandra,

but this time I have created a keyspace and table using AWS Keyspaces in AWS and was trying to connect programmatically, but it was failing to connect using the application.conf and the DriverConfigLoader when used with Spring data cassandra and I have no clue how to pass the DefaultSslEngineFactory using the spring.data.* properties, hence wanted to explore the java-driver-spring-boot from datastax.

I'll look into the link for the mapper example (Astra Java).

0 Likes 0 · ·