EntityBuilder

public interface EntityBuilder

An entity builder is responsible for building the entity class from an Entity schema.

Methods

build

ClassData build(Entity entity)

Builds a class definition for a given entity. The class is not registered with any classloader.

Parameters:
  • entity – the entity schema
Returns:

bytes of the newly constructed class

buildDDE

ClassData buildDDE(Entity entity, Bundle bundle)

Builds Developer Defined Entity. The main difference between regular build method and this one, is that this method fetches the class definition from the given bundle, and injects members to the constructed class from there, if possible, rather than building everything from scratch.

Parameters:
  • entity – the entity schema
  • bundle – the bundle to fetch class definition from
Returns:

bytes of the constructed class

buildHistory

ClassData buildHistory(Entity entity)

Builds History class definition for the given entity. The history class definition contains the same members as the entity class, plus some fields history-exclusive, like schema version.

Parameters:
  • entity – the entity schema
Returns:

bytes of the constructed class

buildTrash

ClassData buildTrash(Entity entity)

Builds Trash class definition for the given entity. The trash class definition contains the same members as the entity class, plus some fields trash-exclusive.

Parameters:
  • entity – the entity schema
Returns:

bytes of the constructed class

prepareHistoryClass

void prepareHistoryClass(Entity entity)

Builds empty history class definition for the given entity and adds it to the class pool.

Parameters:
  • entity – the entity schema

prepareTrashClass

void prepareTrashClass(Entity entity)

Builds empty trash class definition for the given entity and adds it to the class pool.

Parameters:
  • entity – the entity schema