Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/teamapps-org/universal-db-maven-plugin
- Owner: teamapps-org
- License: apache-2.0
- Created: 2019-09-21T12:40:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T17:55:34.000Z (4 months ago)
- Last Synced: 2024-07-08T22:35:31.664Z (4 months ago)
- Language: Java
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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).