Skip to content

Support for immutable POJO

xcesco edited this page May 23, 2019 · 1 revision

Sometimes you need to work with an immutable object. Kripton manages this kind of POJO. To be considered immutable a POJO must have a constructor with all fields and all properties only with getter. This works with Kotlin too.

@BindType
public class Person {

  @BindSqlColumn("birth")
  @BindAdapter(adapter = DateAdapter.class)
  private Date birthDate;
 
  private long id;

  private String name;

  private String surname;

  /**
   * Constructor
   */
  public Person(long id, String name, String surname, Date birthDate) {
    super();
    this.id = id;
    this.name = name;
    this.surname = surname;
    this.birthDate = birthDate;
  }

  public Date getBirthDate() {
    return birthDate;
  }

  public long getId() {
    return id;
  }

  public String getName() {
    return name;
  }

  public String getSurname() {
    return surname;
  }

}

Table of Contents

Query definition

Features

Relations

Multithread supports

Modularization

Annotations for data convertion

Annotations for SQLite ORM

Annotations for shared preferences

Clone this wiki locally