Maven Plugin for UniversalDB

Maven plugin for UniversalDB

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

org.teamapps
ArtifactId

ArtifactId

universal-db-maven-plugin
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Maven Plugin for UniversalDB
Maven plugin for UniversalDB
Project URL

Project URL

https://github.com/teamapps-org/universal-db-maven-plugin
Source Code Management

Source Code Management

https://github.com/teamapps-org/universal-db

Download universal-db-maven-plugin

How to add to project

<plugin>
    <groupId>org.teamapps</groupId>
    <artifactId>universal-db-maven-plugin</artifactId>
    <version>1.2</version>
</plugin>

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.0
org.twdata.maven : mojo-executor jar 2.3.0

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

Project Modules

There are no modules declared in this project.

UniversalDB

An ultra fast embedded persisting in-memory database:

  • Easy and intuitive API through generated POJOs
  • Integrated full text search - including complex joins
  • Integrated file storage - either local or S3 compatible storage with AWS or min.io
  • File parsing and full text indexing

Setting up the dependencies

Current UniversalDB version: Maven Central

<dependency>
  <groupId>org.teamapps</groupId>
  <artifactId>universal-db</artifactId>
  <version>0.4.11</version>
</dependency>

Build configuration

Add this to your pom.xml:

    <build>
        <plugins>
            <plugin>
                <groupId>org.teamapps</groupId>
                <artifactId>universal-db-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate-model</goal>
                        </goals>
                        <configuration>
                            <modelSourceDirectory>${project.basedir}/src/main/model</modelSourceDirectory>
                            <modelClasses>
                                <modelClass>Model</modelClass>
                            </modelClasses>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Create UniversalDB schema

Add a source folder e.g. /src/main/model and create a model class e.g. Model with the model you want to use:

import org.teamapps.universaldb.Database;
import org.teamapps.universaldb.Schema;
import org.teamapps.universaldb.SchemaInfoProvider;
import org.teamapps.universaldb.index.Table;

public class Model implements SchemaInfoProvider {

	public String getSchema() {
		Schema schema = Schema.create();
		Database database = schema.createDatabase("db");
		Table table = database.createTable("table1");
		Table table2 = database.createTable("table2");
		table
				.addText("text1")
				.addText("text2")
				.addTimestamp("timestamp")
				.addEnum("enumValue", "value1", "value2", "value3")
				.addInteger("number")
				.addLong("bigNumber")
				.addReference("reference", table2, true, "backRef");

		table2
				.addText("text")
				.addReference("backRef", table, false, "reference");

		return schema.getSchema();
	}
}

After compiling you will have a Table and a Table2 class to work with.

License

The UniversalDB maven plugin is released under version 2.0 of the Apache License.

org.teamapps

TeamApps

Versions

Version
1.2