Java 8 and Scala Cassandra client.
Go to file
2018-11-10 08:50:02 -05:00
.idea Formatting. 2017-11-02 16:32:09 -04:00
bin Fix build. Change scripts to use /usr/bin/env so that they work on NiXOS. Revert abort() logic. 2018-01-16 13:10:12 -05:00
lib Add code formatting standard to project. 2017-10-06 11:40:19 -04:00
src Repair the copyright per Casser author's request. Also fix DOS line endings. 2018-11-10 08:50:02 -05:00
.gitignore WIP: moving maven build to gradle 2017-08-18 16:50:05 -04:00
AUTHORS Helenus was the son of King Priam and Queen Hecuba of Troy, and the twin brother of the prophetess Cassandra. Like Cassandra, he was always right, but unlike her, others believed him. Seems like a good name for a layer to access DataStax, Apache, or ScyllaDB's implementations of the Cassandra database. 2017-07-27 15:02:17 -04:00
eclipse-formatting.xml eclipse-formatting 2015-03-16 17:03:17 -07:00
helenus-core.iml Remove Zipkin. Revert abstracted UnitOfWork into single class. 2018-03-28 08:27:49 -04:00
LICENSE Initial commit 2015-02-26 12:42:59 -08:00
NOTES Finish first steps of JCache integration, UnitOfWork statement cache now merges into available JCache at commit. 2018-02-08 10:09:23 -05:00
pom.xml Remove Zipkin. Revert abstracted UnitOfWork into single class. 2018-03-28 08:27:49 -04:00 Remove Scala support and trim Future support at some point I'll re-introduce using Java 8 classes rather than Guava's or Scala's 2017-08-04 11:18:54 -04:00


Fast and easy, functional style cutting edge Java 8 Cassandra client for C* 3.x


  • Leverages Java 8 language capabilities to build CQL queries
  • Simple function-style stream API
  • Reactive asynchronous and synchronous API
  • Provides Java mapping for Tables, Tuples, UDTs (User Defined Type), Collections, UDT Collections, Tuple Collections
  • Uses lazy mapping in all cases where possible
  • Supports Java 8 Futures and Guava ListenableFuture


  • JVM 8
  • Datastax Driver 3.x
  • Cassandra 3.x
  • Maven


Latest release dependency:


Simple Example

Model definition:

public interface Timeline {

	UUID userId();

	Date timestamp();

	String text();


Session initialization:

HelenusSession session = Helenus.init(getSession()).showCql().add(Timeline.class).autoCreateDrop().get();
Timeline timeline = Helenus.dsl(Timeline.class, session.getMetadata());

Select example:, timeline::timestamp, timeline::text)
  .where(timeline::userId, eq(userId))

Insert example:

TimelineImpl post = new TimelineImpl();
post.timestamp=new Date(postTime+1000L*i);

Model and Repository Example

Account model:

public interface Account {
	String accountId();
	Date createdAt();
	String organization();
	String team();
	String timezone();
	Map<String, AccountUser> users();

AccountUser model:

public interface AccountUser {
	String email();
	String firstName();
	String lastName();

Abstract repository:

public interface AbstractRepository {
	HelenusSession session();

Account repository:

public interface AccountRepository extends AbstractRepository {

	static final Account account = Helenus.dsl(Account.class);
	static final String DEFAULT_TIMEZONE = "America/Los_Angeles";
	default Future<Optional<Account>> findAccount(String accountId) {

		return session()
				.where(account::accountId, eq(accountId))

	default Future<Fun.Tuple2<ResultSet, String>> createAccount(
			String email,
			AccountUser user,
			String organization,
			String team,
			String timezone) {

		String accountId =;

		if (timezone == null || timezone.isEmpty()) {
			timezone = DEFAULT_TIMEZONE;

		return session()
			.value(account::accountId, accountId)
			.value(account::createdAt, new Date())
			.value(account::organization, organization)
			.value(account::team, team)
			.value(account::timezone, timezone)
			.value(account::users, ImmutableMap.of(email, user))


	default Future<ResultSet> putAccountUser(String accountId, String email, AccountUser user) {

		return session()
				.put(account::users, email.toLowerCase(), user)
				.where(account::accountId, eq(accountId))


	default Future<ResultSet> removeAccountUser(String accountId, String email) {

		return session()
				.put(account::users, email.toLowerCase(), null)
				.where(account::accountId, eq(accountId))


	default Future<ResultSet> dropAccount(String accountId) {

		return session()
				.where(account::accountId, eq(accountId))