Interface CRUDServiceLocal<E extends SimpleEntity,​DTO extends EntityDTO,​D extends EntityData<DTO>,​DP>

    • Method Detail

      • find

        <T extends E> T find​(Long id)
        Finds the entity with the given id
      • getEntityClass

        Class<E> getEntityClass()
        It returns the entity with which this service operates.
      • newEntity

        E newEntity​(DP params)
        Instantiates a new, empty entity. In some (rare) cases where only a single instance of a given entity exists, will return that instance
      • remove

        void remove​(E entity)
        Removes the given entity
      • removeAll

        void removeAll​(Iterable<E> entities)
        Removes all the given entities
      • saveEntity

        default <T extends E> T saveEntity​(DTO dto)
        Saves the given DTO and returns the created entity
      • saveSkippingEntityLog

        Long saveSkippingEntityLog​(DTO dto)
        Saves the DTO, skipping any entity log. Mostly used on tests.
      • toDTO

        DTO toDTO​(E entity)
        Converts the given entity to DTO
      • toEntity

        E toEntity​(DTO dto)
        Converts the given DTO to entity
      • validate

        void validate​(DTO dto)
        Validates the given DTO without saving it
        Throws:
        ValidationException - When the given DTO was invalid