NuoDB

Testing

To test against NuoDB docker test container set the platform to postgres in src/test/resources/application-test.yaml

Refer to docs / testing if application-test.yaml doesn't exist yet.

ebean:
  test:
  platform: nuodb # h2, nuodb, postgres, ...
    ddlMode: dropCreate # none | dropCreate | migrations
    dbName: my_app

ebean-nuodb dependency

We can use the io.ebean:ebean-nuodb dependency rather than io.ebean:ebean if we want to only bring in the NuoDB specific platform code. Depending on io.ebean:ebean will bring in all platforms.

Types

UUID

NuoDB does not have a native UUID type. Instead this will be mapped to database binary(16) or varchar(40) based on the setting of PlatformConfig.DbUuid.

Array types

NuoDB does not have array types and these types are instead simulated.

JSON

Properties with @DbJson and @DbJsonB are mapped to database varchar or clob.

History support

History support for NuoDB is provided by generating triggers and history table.

Table Partitioning

NuoDB supports table partitioning but this is not supported by Ebean yet (via @DbPartition).

Docker container

We can programmatically start a docker container version of NuoDB.

The below uses ebean-test-docker dependency which already comes with ebean-test. If we do not have a dependency on ebean-test then add io.ebean:ebean-test-docker:5.0 as a dependency.

package main;

import io.ebean.docker.commands.NuoDBContainer;

public class Main {

  public static void main(String[] args) {

    NuoDBContainer container = NuoDBContainer.newBuilder("4.0")
      .schema("my_app")
      .user("my_app")
      .password("test")
      .build();

    container.start();
  }
}