Class SubpropertyService
java.lang.Object
gov.niem.tools.api.db.base.BaseEntityService<Subproperty>
gov.niem.tools.api.db.base.BaseVersionEntityService<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.voidaddToCmfModel(Subproperty subproperty, org.mitre.niem.cmf.Model cmfModel, Boolean addDependencies, AddModelReason addModelReason, Test test) Adds the given subproperty to the given CMF model as either a CMF property association or a CMF augmentation record.voidassertRequiredLocalFields(Subproperty subproperty) Checks that the object has the required fields.voidassertUnique(Subproperty subproperty) Checks that the database does not contain a subproperty with the same identifying fields in the given subproperty object.longcountByNamespace(String stewardKey, String modelKey, String versionNumber, String prefix) Count subproperties in the namespace matching the given fields.longcountByProperty(String stewardKey, String modelKey, String versionNumber, String qname) Count subproperties occurrence for the property matching the given fields.longcountByType(String stewardKey, String modelKey, String versionNumber, String qname) Count subproperties for the type matching the given fields.longcountByVersion(String stewardKey, String modelKey, String versionNumber) Count subproperties in the version matching the given fields.findAugmentationPoint(Type type) Find the augmentation point subproperty for the type with the given fields.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.BaseVersionEntityService
getHistory, getNext, getPrevMethods inherited from class gov.niem.tools.api.db.base.BaseEntityService
add, assertFieldNotNullAndNotEmpty, count, 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:
repositoryin 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:
findOnein 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
-
findAugmentationPoint
Find the augmentation point subproperty for the type with the given fields.- Throws:
EntityNotFoundException
-
countByVersion
public long countByVersion(String stewardKey, String modelKey, String versionNumber) throws EntityNotFoundException Count subproperties in the version matching the given fields.- Throws:
EntityNotFoundException
-
countByNamespace
public long countByNamespace(String stewardKey, String modelKey, String versionNumber, String prefix) throws EntityNotFoundException Count subproperties in the namespace matching the given fields.- Throws:
EntityNotFoundException
-
countByType
public long countByType(String stewardKey, String modelKey, String versionNumber, String qname) throws EntityNotFoundException Count subproperties for the type matching the given fields.- Throws:
EntityNotFoundException
-
countByProperty
public long countByProperty(String stewardKey, String modelKey, String versionNumber, String qname) throws EntityNotFoundException Count subproperties occurrence for the property matching the given fields.- Throws:
EntityNotFoundException
-
assertRequiredLocalFields
Description copied from class:BaseEntityServiceChecks that the object has the required fields.- Specified by:
assertRequiredLocalFieldsin 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:
assertUniquein classBaseEntityService<Subproperty>- Throws:
EntityNotUniqueException
-
addToCmfModel
public void addToCmfModel(Subproperty subproperty, org.mitre.niem.cmf.Model cmfModel, Boolean addDependencies, AddModelReason addModelReason, Test test) throws Exception Adds the given subproperty to the given CMF model as either a CMF property association or a CMF augmentation record.- Throws:
Exception
-