|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@ExperimentalApi public interface JsonEntityPropertyManager
Low-level database API for accessing JSON entity properties.
Method Summary | |
---|---|
long |
countByEntity(String entityName,
Long entityId)
Counts the number of properties that match the given entity. |
long |
countByEntityNameAndPropertyKey(String entityName,
String key)
Counts the number of properties that match the given entity name and property key. |
void |
delete(String entityName,
Long entityId,
String key)
Deletes the stored value for an entity property, if it exists. |
void |
deleteByEntity(String entityName,
Long entityId)
Deletes all properties that are associated with the provided entity. |
void |
deleteByEntityNameAndPropertyKey(String entityName,
String key)
Deletes all properties that are associated with the provided entity name and property key. |
List<String> |
findKeys(String entityName,
String keyPrefix)
Produces a list of entity property keys that match the provided entity name and key prefix. |
EntityProperty |
get(String entityName,
Long entityId,
String key)
Look up an entity property by the entity name, entity id, and property key. |
int |
getMaximumValueLength()
The maximum allowed length (in characters) permitted for the String json value
when calling put(String, Long, String, String) . |
void |
put(String entityName,
Long entityId,
String key,
String json)
Set the value for an entity property, creating, updating, or deleting it as necessary. |
com.atlassian.jira.entity.property.EntityPropertyQuery<?> |
query()
Returns a query object for finding, counting, or deleting properties with various restrictions. |
Method Detail |
---|
@Nullable EntityProperty get(String entityName, Long entityId, String key)
null
if the property does not exist.void put(@Nonnull String entityName, @Nonnull Long entityId, @Nonnull String key, @Nullable String json)
entityName
- the entity name for the property (maximum length 255
)entityId
- the entity ID for the propertykey
- the key for the property (maximum length 255
)json
- the new value for the property, or null
to delete it (maximum length
is available by calling getMaximumValueLength()
)
IllegalArgumentException
- if entityName
, key
, or json
exceeds
the maximum permitted length.void delete(@Nonnull String entityName, @Nonnull Long entityId, @Nonnull String key)
entityName
- the entity name for the propertyentityId
- the entity ID for the propertykey
- the key for the propertyint getMaximumValueLength()
String json
value
when calling put(String, Long, String, String)
. This value is currently
32,768
, but this may change in the future.
com.atlassian.jira.entity.property.EntityPropertyQuery<?> query()
EntityPropertyQuery
for usage and minimum requirements.
@Nonnull List<String> findKeys(@Nonnull String entityName, @Nonnull String keyPrefix)
query()
.entityName(entityName)
.keyPrefix(keyPrefix)
.findKeys()
entityName
- the entity name for the entities that are associated with the properties.keyPrefix
- the prefix to apply for limiting which keys are returned; must not be
null
or a blank string
IllegalArgumentException
- if either entityName
or keyPrefix
is null
or blanklong countByEntity(@Nonnull String entityName, @Nonnull Long entityId)
query()
.entityName(entityName)
.entityId(entityId)
.count()
entityName
- the entity name of the owning entityentityId
- the entity ID of the owning entity
IllegalArgumentException
- if either entityName
is null
or blank or entityId
is null
.long countByEntityNameAndPropertyKey(@Nonnull String entityName, @Nonnull String key)
query()
.entityName(entityName)
.key(key)
.count()
entityName
- the entity name of the owning entitieskey
- the property key to look for
IllegalArgumentException
- if either entityName
or key
is null
or blankvoid deleteByEntity(@Nonnull String entityName, @Nonnull Long entityId)
query()
.entityName(entityName)
.entityId(entityId)
.delete()
entityName
- the entity name for the propertiesentityId
- the entity ID for the propertiesvoid deleteByEntityNameAndPropertyKey(@Nonnull String entityName, @Nonnull String key)
query()
.entityName(entityName)
.key(key)
.delete()
entityName
- the entity name for the propertieskey
- the property key for the properties
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |