Class BaseCodeAndDescriptionService<T extends BaseCodeAndDescriptionEntity>


  • public class BaseCodeAndDescriptionService<T extends BaseCodeAndDescriptionEntity>
    extends BaseService<T>
    Author:
    Collin Alpert

    Describes a service class for an entity which contains an id, a code and a description.

    • Constructor Detail

      • BaseCodeAndDescriptionService

        public BaseCodeAndDescriptionService​(java.lang.Class<T> clazz)
    • Method Detail

      • getByCode

        public java.util.Optional<T> getByCode​(java.lang.String code)
        Parameters:
        code - The code to get the entity from.
        Returns:
        An entity matching this code. It is assumed that a code, just like the id, is unique in a table.
      • getByDescription

        public java.util.List<T> getByDescription​(java.lang.String description)
        Parameters:
        description - The description to get the results by.
        Returns:
        A list of entities matching a certain description.