Ferma OrientDB Extension

An OrientDB extension for the Ferma ORM

License

License

GroupId

GroupId

com.syncleus.ferma
ArtifactId

ArtifactId

ferma-orientdb
Last Version

Last Version

3.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Ferma OrientDB Extension
An OrientDB extension for the Ferma ORM
Project URL

Project URL

https://github.com/Syncleus/ferma-orientdb.git
Project Organization

Project Organization

Syncleus
Source Code Management

Source Code Management

https://github.com/Syncleus/ferma-orientdb.git

Download ferma-orientdb

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
com.syncleus.ferma : ferma jar 3.3.0
com.orientechnologies : orientdb-core jar 3.0.1
com.orientechnologies : orientdb-graphdb jar 3.0.1
com.orientechnologies : orientdb-gremlin jar 3.0.1

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
commons-io : commons-io jar 2.5

Project Modules

There are no modules declared in this project.

Ferma OrientDB Extensions

Javadocs Maven Central Gitter

Provides wrappers useful for using OrientDB with Ferma.

Licensed under the Apache Software License v2

For support please use Gitter or the official Ferma mailing list.

Dependency

To include OrientDB extensions to Ferma include the following Maven dependencies into your build.

<dependency>
    <groupId>com.syncleus.ferma</groupId>
    <artifactId>ferma</artifactId>
    <version>3.3.0</version>
</dependency>
<dependency>
    <groupId>com.syncleus.ferma</groupId>
    <artifactId>ferma-orientdb</artifactId>
    <version>3.0.1</version>
</dependency>

Examples

    // Setup the orientdb graph factory from which the transaction factory will create transactions
    try (OrientGraphFactory graphFactory = new OrientGraphFactory("memory:tinkerpop")) {
        TxFactory graph = new OrientTransactionFactoryImpl(graphFactory, false, "com.syncleus.ferma.ext.orientdb.model");

        try (Tx tx = graph.tx()) {
            Person joe = tx.getGraph().addFramedVertex(Person.class);
            joe.setName("Joe");
            Person hugo = tx.getGraph().addFramedVertex(Person.class);
            hugo.setName("Hugo");

            // Both are mutal friends
            joe.addFriend(hugo);
            hugo.addFriend(joe);
            tx.success();
        }

        try (Tx tx = graph.tx()) {
            Iterator<? extends Person> it = tx.getGraph().getFramedVerticesExplicit(Person.class);
            Iterable<? extends Person> it2 = toIterable(it);
            for (Person p : it2) {
                System.out.println("Found person with name: " + p.getName());
            }
        }

        String result = graph.tx((tx) -> {
            Person hugo = tx.getGraph().getFramedVertices("name", "Hugo", Person.class).next();
            StringBuffer sb = new StringBuffer();
            sb.append("Hugo's friends:");

            for (Person p : hugo.getFriends()) {
                sb.append(" " + p.getName());
            }
            return sb.toString();
        });
        System.out.println(result);
    }

Obtaining the Source

The official source repository for OrientDB extension is located in the Syncleus Github repository and can be cloned using the following command.

git clone https://github.com/Syncleus/Ferma-OrientDB.git
com.syncleus.ferma

Syncleus

An open-source business intelligence company.

Versions

Version
3.0.1
3.0.0
2.3.1
2.3.0