I am currently working on a new project and chose Cassandra as our data store. I have a use case where I store prices for material and to accomplish it I created a list of User-Defined Types (UDTs).
I tried using Object Mapper from java driver itself but got stuck at one point where creating an object using InventoryMapperBuilder is throwing compilation error. Is anything additional required towards annotation processing or am I missing something? is it the right way to use Mapper annotation? please check the code snippet below. I also tried using google's AutoService to achieve annotation processing externally but no success yet.
@Mapper
//@AutoService(Processor.class)
public interface InventoryMapperBuilder
// extends Processor
{
static MapperBuilder<InventoryMapperBuilder> builder(CqlSession session) {
return new InventoryMapperBuilder(session);
}
@DaoFactory
ItemPriceByMaterialDao itemPriceByMaterialDao ();
// @DaoFactory
// ItemPriceByMaterialDao itemPriceByMaterialDao(@DaoKeyspace CqlIdentifier
// keyspace);
}
I raised the same at StackOverflow also. Thanks
Version used:
Java Version: 1.8.0_221
DataStax OSS java-driver-mapper-processor: 4.5.1
DataStax OSS java-driver-mapper-runtime: 4.5.1
Cassandra: 3.11.4
Spring Boot Framework: 2.2.4.RELEASE
Below is the compilation error stack trace:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project pricing-api: Compilation failure /Users/i341306/workstation/pricingDB/codebase/PRICINGDB/pricingservice/api/src/main/java/ariba/pricing/cassandra/api/model/price/ItemPriceByMaterialMapper.java:[21,19] error: cannot find symbol symbol: class ItemPriceByMaterialMapperBuilder location: interface ItemPriceByMaterialMapper at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
These are my console logs. Let me know if any other additional info is required.