Database.init

Initializes an entity, either by creating it or updating its fields when it already exists.

class Database
void
init
(
T : Entity
)
()

Examples

class Test : Entity {

   override string tableName() {
       return "test";
   }

   @PrimaryKey
   @AutoIncrement
   Long testId;

   @NotNull
   Integer a;

   @Length(10)
   String b;

}

database.init!Test();

Meta