Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Maven plugin for UniversalDB
https://github.com/teamapps-org/universal-db-maven-plugin

Last synced: 9 days ago
JSON representation

Maven plugin for UniversalDB

Awesome Lists containing this project

README

        

# UniversalDB maven plugin

Maven plugin for UniversalDB

## Build configuration

Add this to your pom.xml:

```xml



org.teamapps
universal-db-maven-plugin
1.2


generate-sources

generate-model


${project.basedir}/src/main/model

Model







```

## Create UniversalDB schema

Add a source folder e.g. `/src/main/model` and create a model class e.g. `Model`:

```java
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("databaseName");
Table table = database.createTable("table1");
Table table2 = database.createTable("table2");
table
.addText("textColumn1")
.addText("textColumn2")
.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();
}
}
```

## License

The UniversalDB maven plugin is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0).