First Entity

Create a package org.example.domain and in that create an entity bean like

package org.example.domain;

import javax.persistence.Id;
import javax.persistence.Entity;

public class Customer {

  long id;

  String name;

  // getters and setters
package org.example.domain

import javax.persistence.Entity
import javax.persistence.Id

class Customer {

  var id: Long = 0

  var name: String? = null


First Test

Create a test in src/test like

package org.example.domain;

import org.junit.Test;

import io.ebean.DB;
import io.ebean.Database;

public class CustomerTest {

 public void insertFindDelete() {

  Customer customer = new Customer();
  customer.setName("Hello world");

  // insert the customer in the DB;

  // Find by Id
  Customer foundHello = database.find(Customer.class, 1);

  // delete the customer
package org.example.domain

import io.ebean.DB
import org.junit.Test

class CustomerTest  {

  fun insert_update_delete() {

    val customer = Customer()  = "Hello entity bean"

    // insert

    // find by Id
    var found = DB.find(, 1);


Run test

Run the test via the IDE and via Maven or Gradle. Check the logs to confirm you see the DDL and SQL that you expect.