Class BaseEntityService<T extends BaseEntity>

java.lang.Object
gov.niem.tools.api.db.base.BaseEntityService<T>
Direct Known Subclasses:
ComponentService, FacetService, ModelService, NamespaceService, StewardService, SubpropertyService, VersionService

public abstract class BaseEntityService<T extends BaseEntity> extends Object
Abstract class that provides basic database operations for data model items.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    add(T object)
    Adds the given object to the database.
    protected static void
    Checks that the given field value is not null and not empty.
    abstract void
    Checks that the object has the required fields.
    abstract void
    assertUnique(T entity)
    Checks that the object will be unique and will not clash with another object in the database.
    void
    delete(T object)
    Deletes the object in the database with the id from the given object.
    edit(Long id, T updatedObject)
    Modifies the object in the database with the given id with the fields from the given object.
    abstract T
    findOne(T object)
    Finds an object based on the given object fields.
    Optionally finds an object based on the given object fields.
    protected String
     
    Throws an exception for when an entity was not found in the database.
    void
    loadId(T object)
    Gets an object from the database matching the given object criteria.
    merge(T object)
    Syncs the given plain object with object information from the database.
    abstract org.springframework.data.jpa.repository.JpaRepository<T,Long>
     
    saveExisting(T object)
    Saves changes in the database to the existing object based on the object id.
    saveNew(T object)
    Adds the object to the database.
    void
    Throws an exception for when an entity was not found in the database.
    void
    Throws an exception for when an entity was not found in the database.
    void
    throwNotFound(String entityClassName, String label)
    Throws an exception for when an entity was not found in the database.
    void
    Throws an exception for when an entity with the same required fields already exists in the database.
    void
    Throws an exception for when an entity with the same required fields already exists in the database.
    void
    throwNotUnique(String entityClassName, String label)
    Throws an exception for when an entity with the same required fields already exists in the database.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait