Package gov.niem.tools.api.db.steward
Class StewardService
Operations for managing a steward.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a steward to the database.Add a steward to the database.add
(String shortName, String longName, Steward.Category category) Add a steward to the database.add
(String shortName, String longName, Steward.Category category, String description) Add a steward to the database.Add a steward to the database.void
assertRequiredLocalFields
(Steward steward) Check that the given steward has all required fields.void
assertUnique
(Steward steward) Check that the given steward is unique from other stewards in the database.void
Delete the steward with the given key.Modify a steward in the database identified by the given key.Find one steward by the key in the given steward object.Find one steward by the given key.findOneByShortName
(String shortName) Find one steward by the short name in the given steward object.Find the NIEM steward.findOneOptional
(String stewardKey) Optionally find one steward by the given key.Methods inherited from class gov.niem.tools.api.db.base.BaseEntityService
add, assertFieldNotNullAndNotEmpty, delete, edit, findOneOptional, getEntityClassName, getNotFoundException, loadId, merge, saveExisting, saveNew, throwNotFound, throwNotFound, throwNotFound, throwNotUnique, throwNotUnique, throwNotUnique
-
Field Details
-
repo
-
-
Constructor Details
-
StewardService
public StewardService()
-
-
Method Details
-
repository
- Specified by:
repository
in classBaseEntityService<Steward>
-
add
Add a steward to the database.- Throws:
Exception
-
add
Add a steward to the database.- Throws:
Exception
-
add
Add a steward to the database.- Throws:
Exception
-
add
Add a steward to the database.- Throws:
Exception
-
add
public Steward add(String shortName, String longName, Steward.Category category, String description) throws Exception Add a steward to the database.- Throws:
Exception
-
edit
Modify a steward in the database identified by the given key. Replace all existing fields with the given fields.- Throws:
Exception
-
delete
Delete the steward with the given key.- Throws:
Exception
-
findOneOptional
Optionally find one steward by the given key. -
findOne
Find one steward by the key in the given steward object.- Specified by:
findOne
in classBaseEntityService<Steward>
- Throws:
EntityNotFoundException
-
findOne
Find one steward by the given key.- Throws:
EntityNotFoundException
-
findOneByShortName
Find one steward by the short name in the given steward object.- Throws:
EntityNotFoundException
-
findOneNiem
Find the NIEM steward.- Throws:
EntityNotFoundException
-
assertRequiredLocalFields
Check that the given steward has all required fields.- Specified by:
assertRequiredLocalFields
in classBaseEntityService<Steward>
- Throws:
FieldNotFoundException
-
assertUnique
Check that the given steward is unique from other stewards in the database.- Specified by:
assertUnique
in classBaseEntityService<Steward>
- Throws:
EntityNotUniqueException
-