rethink-java-driver

A Java RethinkDB Driver

License

License

Categories

Categories

Java Languages
GroupId

GroupId

com.rethinkdb
ArtifactId

ArtifactId

rethink-java-driver
Last Version

Last Version

0.3
Release Date

Release Date

Type

Type

jar
Description

Description

rethink-java-driver
A Java RethinkDB Driver
Project URL

Project URL

https://github.com/npiv/rethink-java-driver
Source Code Management

Source Code Management

https://github.com/npiv/rethink-java-driver

Download rethink-java-driver

How to add to project

<!-- https://jarcasting.com/artifacts/com.rethinkdb/rethink-java-driver/ -->
<dependency>
    <groupId>com.rethinkdb</groupId>
    <artifactId>rethink-java-driver</artifactId>
    <version>0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.rethinkdb/rethink-java-driver/
implementation 'com.rethinkdb:rethink-java-driver:0.3'
// https://jarcasting.com/artifacts/com.rethinkdb/rethink-java-driver/
implementation ("com.rethinkdb:rethink-java-driver:0.3")
'com.rethinkdb:rethink-java-driver:jar:0.3'
<dependency org="com.rethinkdb" name="rethink-java-driver" rev="0.3">
  <artifact name="rethink-java-driver" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.rethinkdb', module='rethink-java-driver', version='0.3')
)
libraryDependencies += "com.rethinkdb" % "rethink-java-driver" % "0.3"
[com.rethinkdb/rethink-java-driver "0.3"]

Dependencies

compile (4)

Group / Artifact Type Version
com.google.protobuf : protobuf-java jar 2.5.0
org.slf4j : slf4j-api jar 1.6.6
com.google.guava : guava jar 17.0
ch.qos.logback : logback-classic jar 1.0.9

test (2)

Group / Artifact Type Version
junit : junit jar 4.11
org.easytesting : fest-assert jar 1.4

Project Modules

There are no modules declared in this project.

NOTICE

I am not actively using rethink anymore and have little time to maintain the project. It may be possible that time opens up in the near future, but if anyone is eager to take this over / help out they are welcome to contact me.

Introduction

Full Documentation here

Maven Central

Include in your pom with

<dependency>
    <groupId>com.rethinkdb</groupId>
    <artifactId>rethink-java-driver</artifactId>
    <version>0.3</version>
</dependency>

Examples

The driver supports java 1.6 and up. But to truly get the benefit of the lambda support java 8 is recommended.

in java 8 one can do something Like

RethinkDB r = RethinkDB.r;
RethinkDBConnection con = r.connect();

r.db("test").tableCreate("heros").run(con);
con.use("test");

r.table("heros").insert(
        new MapObject().with("name", "Heman").with("age", 33).with("skill", "sword"),
        new MapObject().with("name", "Spiderman").with("age", 27).with("skill", "jumping"),
        new MapObject().with("name", "Superman").with("age", 133).with("skill", "flying"),
        new MapObject().with("name", "Xena").with("age", 29).with("skill", "wowza")
).run(con);

System.out.println(
        r.table("heros").filter(hero->hero.field("age").gt(100)).pluck("age").run(con)
); // [{age=133.0}]

System.out.println(
        r.table("heros").orderBy(r.desc("age")).map(hero -> hero.field("name").upcase()).run(con)
); // [SUPERMAN, HEMAN, XENA, SPIDERMAN]

System.out.println(
        r.table("heros").update(row ->
                        r.branch(
                                row.field("age").gt(100),
                                new MapObject().with("newAttribute", "old"),
                                new MapObject().with("newAttribute", "young")
                        )
        ).run(con)
); // DMLResult{inserted=0, replaced=4, unchanged=0, errors=0, first_error=null, deleted=0, skipped=0, generated_keys=null, old_val=null, new_val=null}

System.out.println(
        r.table("heros").pluck("name","newAttribute").run(con)
); // [
   // {newAttribute=young, name=Xena},
   // {newAttribute=young, name=Spiderman},
   // {newAttribute=old,   name=Superman},
   // {newAttribute=young, name=Heman}
   // ]

See API Documentation and more examples here: http://npiv.github.io/rethink-java-doc/html

Apache License 2.0

Copyright [2014] [Nick Verlinde]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
0.3
0.2