Class PersistentEntityFactory<T>

java.lang.Object
com.foreach.across.modules.entity.registry.PersistentEntityFactory<T>
All Implemented Interfaces:
EntityFactory<T>
Direct Known Subclasses:
DtoAwarePersistentEntityFactory

public class PersistentEntityFactory<T> extends Object implements EntityFactory<T>
Creates a basic EntityFactory from a PersistentEntity instance.
See Also:
  • Constructor Details

    • PersistentEntityFactory

      public PersistentEntityFactory(org.springframework.data.mapping.PersistentEntity<T,?> persistentEntity)
  • Method Details

    • createNew

      public T createNew(Object... args)
      Description copied from interface: EntityFactory
      Create a new entity instance. In case of an EntityFactory for an association, the first (and often only) argument will be the parent entity.
      Specified by:
      createNew in interface EntityFactory<T>
      Parameters:
      args - constructor arguments
      Returns:
      new instance
    • createDto

      public T createDto(T entity)
      Description copied from interface: EntityFactory
      Create a DTO of an existing entity.
      Specified by:
      createDto in interface EntityFactory<T>
      Parameters:
      entity - to create a DTO for
      Returns:
      dto