cassandra-modelgen

Generate static metamodel classes from cassandra driver annotations which allows queries to be constructed in a strongly-typed manner.

License

License

Categories

Categories

Cassandra Data Databases
GroupId

GroupId

com.github.laci009
ArtifactId

ArtifactId

cassandra-modelgen
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

cassandra-modelgen
Generate static metamodel classes from cassandra driver annotations which allows queries to be constructed in a strongly-typed manner.
Project URL

Project URL

https://github.com/laci009/cassandra-modelgen
Source Code Management

Source Code Management

http://github.com/laci009/cassandra-modelgen/tree/master

Download cassandra-modelgen

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.laci009/cassandra-modelgen/ -->
<dependency>
    <groupId>com.github.laci009</groupId>
    <artifactId>cassandra-modelgen</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.laci009/cassandra-modelgen/
implementation 'com.github.laci009:cassandra-modelgen:1.0.0'
// https://jarcasting.com/artifacts/com.github.laci009/cassandra-modelgen/
implementation ("com.github.laci009:cassandra-modelgen:1.0.0")
'com.github.laci009:cassandra-modelgen:jar:1.0.0'
<dependency org="com.github.laci009" name="cassandra-modelgen" rev="1.0.0">
  <artifact name="cassandra-modelgen" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.laci009', module='cassandra-modelgen', version='1.0.0')
)
libraryDependencies += "com.github.laci009" % "cassandra-modelgen" % "1.0.0"
[com.github.laci009/cassandra-modelgen "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.datastax.cassandra : cassandra-driver-mapping jar 3.2.0
org.apache.velocity : velocity jar 1.7

Project Modules

There are no modules declared in this project.

cassandra-modelgen

Generate static metamodel classes from cassandra driver annotations which allows queries to be constructed in a strongly-typed manner.

Usage

<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>${maven-compiler-plugin.version}</version>
  <configuration>
    <source>1.8</source>
    <target>1.8</target>
    <annotationProcessors>
      <annotationProcessor>com.github.laci009.cassandra.modelgen.CassandraModelProcessor</annotationProcessor>
    </annotationProcessors>
  </configuration>
</plugin>
...
<dependency>
  <groupId>com.github.laci009</groupId>
  <artifactId>cassandra-modelgen</artifactId>
  <version>1.0.0</version>
</dependency>

After compile you can use generated metamodel classes with _ postfix to create queries. In @Accessor annotated class:

    @Query("SELECT * FROM " + UserData_._table + " " +
    "WHERE " + UserDat_.userId + " = :userId")
    Result<UserData> findUserById(String userId);

Versions

Version
1.0.0