Class BaseCodeAndDescriptionService<T extends BaseCodeAndDescriptionEntity>
- java.lang.Object
-
- com.github.collinalpert.java2db.services.BaseService<T>
-
- com.github.collinalpert.java2db.services.BaseCodeAndDescriptionService<T>
-
public class BaseCodeAndDescriptionService<T extends BaseCodeAndDescriptionEntity> extends BaseService<T>
Describes a service class for an entity which contains an id, a code and a description.- Author:
- Collin Alpert
-
-
Constructor Summary
Constructors Constructor Description BaseCodeAndDescriptionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<T>getByCode(java.lang.String code)java.util.List<T>getByDescription(java.lang.String description)-
Methods inherited from class com.github.collinalpert.java2db.services.BaseService
any, any, count, count, create, create, create, createPagination, createPagination, createPagination, createPagination, createQuery, delete, delete, delete, delete, delete, delete, getAll, getAll, getAll, getAll, getAll, getAll, getById, getMultiple, getSingle, hasDuplicates, truncateTable, update, update
-
-
-
-
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.
-
-