Class SubpropertyService
java.lang.Object
gov.niem.tools.api.db.base.BaseEntityService<Subproperty>
gov.niem.tools.api.db.subproperty.SubpropertyService
Operations for subproperties.
- Todo:
- Return Subproperty lists instead of sets
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new subproperty in the database and adds it to the type with the given type.Creates a new subproperty in the database and adds it to the type with the given type fields.add
(String stewardKey, String modelKey, String versionNumber, String typeQname, String propertyQname, String min, String max) Creates a new subproperty in the database and adds it to the type with the given type fields.void
assertRequiredLocalFields
(Subproperty subproperty) Checks that the object has the required fields.void
assertUnique
(Subproperty subproperty) Checks that the database does not contain a subproperty with the same identifying fields in the given subproperty object.findByProperty
(Property property) Finds all subproperties in the database with the given property.findByProperty
(String stewardKey, String modelKey, String versionNumber, String qname) Finds all subproperties in the database in the version with the given version fields and with the property with the given qualified property name.findByPropertyPrefix
(String stewardKey, String modelKey, String versionNumber, String prefix) Finds all subproperties in the database in the version with the given version fields and with properties with the given namespace prefix.findByType
(Type type) Finds the subproperties from the database in the given type.findByType
(String stewardKey, String modelKey, String versionNumber, String qname) Finds the subproperties from the database in the type with the given fields.findByTypePrefix
(String stewardKey, String modelKey, String versionNumber, String prefix) Finds all subproperties in the database in the version with the given version fields and with types with the given namespace prefix.findByVersion
(String stewardKey, String modelKey, String versionNumber) Finds all subproperties in the database in the version with the given fields.findOne
(Subproperty subproperty) Finds a subproperty in the database with the identifying fields from the given subproperty object.Finds a subproperty in the database with the given type and property.Finds a subproperty in the database with the type with the given version and qualified type name and the property with the given qualified property name.findOne
(String stewardKey, String modelKey, String versionNumber, String typeQname, String propertyQname) Finds a subproperty in the database with the type with the given type fields and the property with the given qualified property name.findOneOptional
(Version version, String typeQname, String propertyQname) Optionally finds a subproperty in the database with a type with the given version and qualified type name and a property with the given qualified property name.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
-
Constructor Details
-
SubpropertyService
public SubpropertyService()
-
-
Method Details
-
repository
- Specified by:
repository
in classBaseEntityService<Subproperty>
-
add
public Subproperty add(String stewardKey, String modelKey, String versionNumber, String typeQname, String propertyQname, String min, String max) throws Exception Creates a new subproperty in the database and adds it to the type with the given type fields.- Throws:
Exception
-
add
public Subproperty add(Version version, String typeQname, String propertyQname, String min, String max) throws Exception Creates a new subproperty in the database and adds it to the type with the given type fields.- Throws:
Exception
-
add
Creates a new subproperty in the database and adds it to the type with the given type.- Throws:
Exception
-
findOne
Finds a subproperty in the database with the identifying fields from the given subproperty object.- Specified by:
findOne
in classBaseEntityService<Subproperty>
- Throws:
EntityNotFoundException
-
findOne
public Subproperty findOne(String stewardKey, String modelKey, String versionNumber, String typeQname, String propertyQname) throws EntityNotFoundException Finds a subproperty in the database with the type with the given type fields and the property with the given qualified property name.- Throws:
EntityNotFoundException
-
findOne
public Subproperty findOne(Version version, String typeQname, String propertyQname) throws EntityNotFoundException Finds a subproperty in the database with the type with the given version and qualified type name and the property with the given qualified property name.- Throws:
EntityNotFoundException
-
findOne
Finds a subproperty in the database with the given type and property.- Throws:
EntityNotFoundException
-
findOneOptional
public Optional<Subproperty> findOneOptional(Version version, String typeQname, String propertyQname) Optionally finds a subproperty in the database with a type with the given version and qualified type name and a property with the given qualified property name. -
findByType
public Set<Subproperty> findByType(String stewardKey, String modelKey, String versionNumber, String qname) throws Exception Finds the subproperties from the database in the type with the given fields.- Throws:
Exception
-
findByType
Finds the subproperties from the database in the given type.- Throws:
Exception
-
findByProperty
public Set<Subproperty> findByProperty(String stewardKey, String modelKey, String versionNumber, String qname) throws Exception Finds all subproperties in the database in the version with the given version fields and with the property with the given qualified property name.- Throws:
Exception
-
findByProperty
Finds all subproperties in the database with the given property.- Throws:
Exception
-
findByVersion
public Set<Subproperty> findByVersion(String stewardKey, String modelKey, String versionNumber) throws Exception Finds all subproperties in the database in the version with the given fields.- Throws:
Exception
-
findByTypePrefix
public Set<Subproperty> findByTypePrefix(String stewardKey, String modelKey, String versionNumber, String prefix) throws Exception Finds all subproperties in the database in the version with the given version fields and with types with the given namespace prefix.- Throws:
Exception
-
findByPropertyPrefix
public Set<Subproperty> findByPropertyPrefix(String stewardKey, String modelKey, String versionNumber, String prefix) throws Exception Finds all subproperties in the database in the version with the given version fields and with properties with the given namespace prefix.- Throws:
Exception
-
assertRequiredLocalFields
Description copied from class:BaseEntityService
Checks that the object has the required fields.- Specified by:
assertRequiredLocalFields
in classBaseEntityService<Subproperty>
- Throws:
FieldNotFoundException
-
assertUnique
Checks that the database does not contain a subproperty with the same identifying fields in the given subproperty object.- Specified by:
assertUnique
in classBaseEntityService<Subproperty>
- Throws:
EntityNotUniqueException
-