Interface NameEntityService<T extends io.github.astrapi69.data.nameable.Nameable>


public interface NameEntityService<T extends io.github.astrapi69.data.nameable.Nameable>
  • Method Summary

    Modifier and Type
    Method
    Description
    findEntities(String nameValue)
    Find the entities objects from the given name value.
    default T
    findFirst(String nameValue)
    Find the entity object from the given name value.
    default T
    Gets the or creates a new entity object
    merge(T object)
    Merges the given object.
    Factory method for create a new name entity.
  • Method Details

    • findEntities

      List<T> findEntities(String nameValue)
      Find the entities objects from the given name value.
      Parameters:
      nameValue - the name value
      Returns:
      the list with the entities
    • findFirst

      default T findFirst(String nameValue)
      Find the entity object from the given name value.
      Parameters:
      nameValue - the name value
      Returns:
      the found entity object or null if not.
    • getOrCreateNewNameEntity

      @Transactional default T getOrCreateNewNameEntity(String value)
      Gets the or creates a new entity object
      Parameters:
      value - the value
      Returns:
      the entity object
    • merge

      T merge(T object)
      Merges the given object. @see Hibernate documentation.
      Parameters:
      object - the object
      Returns:
      the object
    • newNameEntity

      T newNameEntity(String value)
      Factory method for create a new name entity.
      Parameters:
      value - the value
      Returns:
      the new name entity