public interface KrmsAttributeDefinitionService
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
This method clears the cache of AttributeDefinitionBo objects.
|
Map<String,String> |
convertAttributeKeys(Map<String,String> attributesByName,
String namespace)
This method converts a collection of name/value attribute pairs to
id/value attribute pairs.
|
KrmsAttributeDefinition |
createAttributeDefinition(KrmsAttributeDefinition attributeDefinition)
This will create a
KrmsAttributeDefinition exactly like the parameter passed in. |
List<KrmsAttributeDefinition> |
findAllAttributeDefinitions()
Returns all KrmsAttributeDefinitions
|
List<KrmsAttributeDefinition> |
findAttributeDefinitionsByNamespace(String namespace)
Returns all KrmsAttributeDefinition that for a given namespace.
|
List<KrmsAttributeDefinition> |
findAttributeDefinitionsByType(String typeId)
Returns all KrmsAttributeDefinition that for a given type.
|
KrmsAttributeDefinition |
getAttributeDefinitionById(String id)
Lookup a KrmsAttributeDefinition based on the given id.
|
KrmsAttributeDefinition |
getAttributeDefinitionByNameAndNamespace(String name,
String namespace)
Get a KrmsAttributeDefinition object based on name and namespace
|
org.kuali.rice.krms.impl.repository.KrmsAttributeDefinitionBo |
getKrmsAttributeBo(String attributeName,
String namespace)
This method gets a KrmsAttributeDefinitionBo object for a given attribute.
|
String |
getKrmsAttributeId(String attributeName,
String namespace)
This method gets the attribute definition ID for a given attribute
|
void |
updateAttributeDefinition(KrmsAttributeDefinition attributeDefinition)
This will update a
KrmsAttributeDefinition . |
KrmsAttributeDefinition createAttributeDefinition(KrmsAttributeDefinition attributeDefinition)
KrmsAttributeDefinition
exactly like the parameter passed in.attributeDefinition
- - KrmsAttributeDefinitionIllegalArgumentException
- if the attribute definition is nullIllegalStateException
- if the attribute definition already exists in the systemvoid updateAttributeDefinition(KrmsAttributeDefinition attributeDefinition)
KrmsAttributeDefinition
.attributeDefinition
- - KrmsAttributeDefinitionIllegalArgumentException
- if the attribute definition is nullIllegalStateException
- if the attribute definition does not exist in the systemKrmsAttributeDefinition getAttributeDefinitionById(String id)
id
- the given KrmsAttributeDefinition idKrmsAttributeDefinition getAttributeDefinitionByNameAndNamespace(String name, String namespace)
name
- the given namenamespace
- the given type namespaceIllegalStateException
- if multiple KrmsAttributeDefinitions exist with the same name and namespaceList<KrmsAttributeDefinition> findAttributeDefinitionsByNamespace(String namespace)
List<KrmsAttributeDefinition> findAttributeDefinitionsByType(String typeId)
List<KrmsAttributeDefinition> findAllAttributeDefinitions()
Map<String,String> convertAttributeKeys(Map<String,String> attributesByName, String namespace)
At the api layer, attributes are represented as name/value pairs. However, in the database, the names of the attribute and the values are stored separately. The attribute definitions contain the attribute names. All defined attributes(for the various krms entity types) are stored together in a single table. The attribute values themselves are stored in separate tables for each entity type, and then reference the attribute definitions by the attribute definition id.
This method converts the name/value pairs to id/value pairs so they can be searched from a single table. This simplifies the queries for attributes.
attributesByName
- - a Mapnamespace
- - the namespace code of the set of attributesString getKrmsAttributeId(String attributeName, String namespace)
attributeName
- - the name of the attributenamespace
- - the namespace code of the attributeorg.kuali.rice.krms.impl.repository.KrmsAttributeDefinitionBo getKrmsAttributeBo(String attributeName, String namespace)
attributeName
- - the name of the attributenamespace
- - the namespace code of the attributevoid clearCache()
Since searching for attribute definitions is a common operation, the attribute definitions fetched from the database are cached to improve performance.
Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.