Blog

How to declare minimum required properties in your data classes

by on April 15, 2015

In another post where we showed how to update data objects in the persistent storage, our class for the data object looked like this:

package com.mbaas.sample;
import java.util.Date;
public class Person
{
    public int age;
    public String name;
    public Date birthdate;
}

Notice that the class does not include any fields/properties for the objectId, created, or updated fields. Nevertheless, the call to save the updated object knew that it was already stored in Backendless Database. This is possible because of a feature that lets you declare any field or property your app might need. Also, notice that the class neither implements any special interfaces nor extends any base Backendless classes – a pure data object class.