⚑Quick Start

Setup Build Tools (Maven or Gradle)

<repositories>
    <repository>
        <id>minecodes-repository</id>
        <url>https://repository.minecodes.pl/releases</url>
     </repository>
</repositories>
    
<dependencies>
    <dependency>
        <groupId>pl.szczurowsky</groupId>
        <artifactId>rat-orm-mongodb</artifactId>
        <version>1.4.0</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

Connect to data source

public class Example {
    
    Database database;
    
    public void connect() {
        // Replace MongoDB() with your database type
        this.database = new MongoDB();
        Map<String, String> credentials = new HashMap<>();
        credentials.put("name", "name of db");
        credentials.put("username", "username");
        credentials.put("password", "password");
        credentials.put("host", "DNS or IP");
        credentials.put("port", "port");
        this.database.connect(credentials);
    }
    
}

Create model

Now to initialize model

CRUD

Create

Model is being saved to database and also to local cache

Now we want to create object basing on our model

Read

Update

Update works same as saving - Just save updated object and it will be replaced by updated

Delete

Last updated