findOrCreate

protected final P findOrCreate(I id)

Loads an entity by the passed ID or creates a new one, if the entity was not found.

An entity will be loaded whether its WithLifecycle#isActive() active or not.

The new entity is created if and only if there is no record with the corresponding ID.

Overrides to perform finding using the cache.