A badge people can be nominated for in a recognition programme, such as a values or long service award. RecognitionBadge is one of the recognition types stored in the shared recognition table and is told apart by its discriminator, so it inherits the topic, title, image, colour and points settings from BaseRecognition. What it adds is who may nominate and who may be nominated, each held as a KSelector definition rather than a fixed list of people. Nominations against the badge are RecognitionNomination rows.
Group: Database Entities
Extends: BaseRecognition
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| allowedNominators | String | KSelector definition, held as JSON, saying who is allowed to nominate someone for this badge. Null means no restriction has been configured, so read it as a selector rather than as a list of people. |
| allowedNominees | String | KSelector definition, held as JSON, saying who may be nominated for this badge. Null means no restriction has been configured. |
Inherited from BaseRecognition
Properties
| Property | Returns | Description |
|---|---|---|
| adminDomain | Organisation | The administrative organisation this recognition was defined in. Loaded lazily. |
| assetId | String | Identifier of an asset library item linked to this recognition, used as an alternative to an uploaded image. Null when no asset is linked. |
| colour | String | Display colour for this badge or level, as entered in the admin UI, typically a CSS colour value. Null when no colour has been chosen. |
| field1 | String | First general purpose custom field, free text, available for account specific data such as an external code. On a level it can also be read by name through fieldValue. |
| field2 | String | Second general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue. |
| field3 | String | Third general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue. |
| id | long | The database identifier of this badge or level. |
| imageHash | String | Hash of the badge or level image held in the blob store, used to render the artwork. Null when no image has been uploaded. |
| name | String | Portable, path-safe identifier for this badge or level, used in URLs and as the lookup key. Distinct from the title, which is only a display label. Never null for a persisted record. |
| numAwarded | Long | Counts how many RecognitionAward rows currently exist for this badge or level. This is not a mapped column: it runs a count query against the database on every call, so avoid calling it inside a loop. |
| numPoints | Double | Fixed number of points allocated each time this recognition is awarded. Null when no fixed amount applies, for example when a points rule calculates the amount instead. |
| pointsBucket | Reward | The points bucket, held as a Reward, that points earned from this recognition are credited to. Null when this recognition does not allocate points. Loaded lazily. |
| pointsExpiryRuleConfig | String | Configuration for the points expiry rule named by the points expiry rule type identifier, stored as XML. Up to 2000 characters, and null when the rule needs no configuration. |
| pointsExpiryRuleTypeId | String | Identifier of the PointsExpiryRuleType which decides when points allocated by this recognition expire. Null when the allocated points do not expire. |
| pointsReason | String | Custom reason text recorded against points allocated by this recognition, shown to the member in their points history. Up to 1000 characters, and null to fall back to the default reason. |
| pointsRuleConfig | String | Configuration for the points rule named by the points rule type identifier, stored as XML. Up to 2000 characters, and null when the rule needs no configuration. |
| pointsRuleTypeId | String | Identifier of the RecognitionPointsRuleType which calculates how many points to allocate when this recognition is awarded. Null when a fixed number of points is used instead. |
| pointsTag | PointsTag | Optional tag applied to any points allocated by this recognition, so those points can be reported on separately from other allocations. Null when the points are untagged. |
| title | String | Free-text display label shown to members, such as Gold or Safety Champion. Carries no uniqueness or path-safety guarantee, unlike the name. Never null for a persisted record. |
| topic | RecognitionTopic | The topic this badge or level belongs to. A topic acts as the folder for a set of recognitions, and for levels it defines the metric the levels are measured on. Never null for a persisted record, and loaded lazily. |
| type | String | Discriminator code identifying which kind of recognition this row is: B for a badge, L for a level. The column is mapped read-only, so it is set by Hibernate from the concrete class rather than by application code. |
Methods
getId() · getType() · setType(String type) · getAdminDomain() · setAdminDomain(Organisation adminDomain) · getTopic() · setTopic(RecognitionTopic topic) · getPointsTag() · setPointsTag(PointsTag pointsTag) · getPointsReason() · setPointsReason(String pointsReason) · getName() · setName(String name) · getTitle() · setTitle(String title) · getImageHash() · setImageHash(String imageHash) · getColour() · setColour(String colour) · getAssetId() · setAssetId(String assetId) · getField1() · setField1(String field1) · getField2() · setField2(String field2) · getField3() · setField3(String field3) · getPointsBucket() · setPointsBucket(Reward pointsBucket) · getNumPoints() · setNumPoints(Double numPoints) · getPointsRuleTypeId() · setPointsRuleTypeId(String pointsRuleTypeId) · getPointsRuleConfig() · setPointsRuleConfig(String pointsRuleConfig) · getPointsExpiryRuleTypeId() · setPointsExpiryRuleTypeId(String pointsExpiryRuleTypeId) · getPointsExpiryRuleConfig() · setPointsExpiryRuleConfig(String pointsExpiryRuleConfig) · getNumAwarded() · rowId()
getId()
Returns: long
The database identifier of this badge or level.
getType()
Returns: String
Discriminator code identifying which kind of recognition this row is: B for a badge, L for a level. The column is mapped read-only, so it is set by Hibernate from the concrete class rather than by application code.
setType(String type)
Returns: void
Sets the recognition type code. The underlying column is mapped as neither insertable nor updatable, so the stored value is unaffected.
| Parameter | Description |
|---|---|
type | the recognition type code to hold in memory |
getAdminDomain()
Returns: Organisation
The administrative organisation this recognition was defined in. Loaded lazily.
setAdminDomain(Organisation adminDomain)
Returns: void
Sets the administrative organisation this recognition was defined in.
| Parameter | Description |
|---|---|
adminDomain | the owning admin organisation |
getTopic()
Returns: RecognitionTopic
The topic this badge or level belongs to. A topic acts as the folder for a set of recognitions, and for levels it defines the metric the levels are measured on. Never null for a persisted record, and loaded lazily.
setTopic(RecognitionTopic topic)
Returns: void
Sets the topic this badge or level belongs to.
| Parameter | Description |
|---|---|
topic | the owning recognition topic |
getPointsTag()
Returns: PointsTag
Optional tag applied to any points allocated by this recognition, so those points can be reported on separately from other allocations. Null when the points are untagged.
setPointsTag(PointsTag pointsTag)
Returns: void
Sets the tag applied to points allocated by this recognition.
| Parameter | Description |
|---|---|
pointsTag | the points tag to apply, or null for none |
getPointsReason()
Returns: String
Custom reason text recorded against points allocated by this recognition, shown to the member in their points history. Up to 1000 characters, and null to fall back to the default reason.
setPointsReason(String pointsReason)
Returns: void
Sets the custom reason text recorded against points allocated by this recognition.
| Parameter | Description |
|---|---|
pointsReason | the custom points reason, up to 1000 characters |
getName()
Returns: String
Portable, path-safe identifier for this badge or level, used in URLs and as the lookup key. Distinct from the title, which is only a display label. Never null for a persisted record.
setName(String name)
Returns: void
Sets the portable, path-safe identifier for this badge or level.
| Parameter | Description |
|---|---|
name | the recognition's name, which must not be null |
getTitle()
Returns: String
Free-text display label shown to members, such as Gold or Safety Champion. Carries no uniqueness or path-safety guarantee, unlike the name. Never null for a persisted record.
setTitle(String title)
Returns: void
Sets the free-text display label shown to members.
| Parameter | Description |
|---|---|
title | the recognition's display title, which must not be null |
getImageHash()
Returns: String
Hash of the badge or level image held in the blob store, used to render the artwork. Null when no image has been uploaded.
setImageHash(String imageHash)
Returns: void
Sets the blob hash of the badge or level image.
| Parameter | Description |
|---|---|
imageHash | the blob hash of the image, or null for none |
getColour()
Returns: String
Display colour for this badge or level, as entered in the admin UI, typically a CSS colour value. Null when no colour has been chosen.
setColour(String colour)
Returns: void
Sets the display colour for this badge or level.
| Parameter | Description |
|---|---|
colour | the display colour, or null for none |
getAssetId()
Returns: String
Identifier of an asset library item linked to this recognition, used as an alternative to an uploaded image. Null when no asset is linked.
setAssetId(String assetId)
Returns: void
Sets the identifier of the asset library item linked to this recognition.
| Parameter | Description |
|---|---|
assetId | the linked asset identifier, or null for none |
getField1()
Returns: String
First general purpose custom field, free text, available for account specific data such as an external code. On a level it can also be read by name through fieldValue.
setField1(String field1)
Returns: void
Sets the first general purpose custom field.
| Parameter | Description |
|---|---|
field1 | the value to store in custom field 1 |
getField2()
Returns: String
Second general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue.
setField2(String field2)
Returns: void
Sets the second general purpose custom field.
| Parameter | Description |
|---|---|
field2 | the value to store in custom field 2 |
getField3()
Returns: String
Third general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue.
setField3(String field3)
Returns: void
Sets the third general purpose custom field.
| Parameter | Description |
|---|---|
field3 | the value to store in custom field 3 |
getPointsBucket()
Returns: Reward
The points bucket, held as a Reward, that points earned from this recognition are credited to. Null when this recognition does not allocate points. Loaded lazily.
setPointsBucket(Reward pointsBucket)
Returns: void
Sets the points bucket that points earned from this recognition are credited to.
| Parameter | Description |
|---|---|
pointsBucket | the reward acting as the points bucket, or null for none |
getNumPoints()
Returns: Double
Fixed number of points allocated each time this recognition is awarded. Null when no fixed amount applies, for example when a points rule calculates the amount instead.
setNumPoints(Double numPoints)
Returns: void
Sets the fixed number of points allocated each time this recognition is awarded.
| Parameter | Description |
|---|---|
numPoints | the number of points to allocate, or null for none |
getPointsRuleTypeId()
Returns: String
Identifier of the RecognitionPointsRuleType which calculates how many points to allocate when this recognition is awarded. Null when a fixed number of points is used instead.
setPointsRuleTypeId(String pointsRuleTypeId)
Returns: void
Sets the identifier of the points rule type used to calculate the points allocation.
| Parameter | Description |
|---|---|
pointsRuleTypeId | the points rule type identifier, or null for none |
getPointsRuleConfig()
Returns: String
Configuration for the points rule named by the points rule type identifier, stored as XML. Up to 2000 characters, and null when the rule needs no configuration.
setPointsRuleConfig(String pointsRuleConfig)
Returns: void
Sets the XML configuration for the points rule.
| Parameter | Description |
|---|---|
pointsRuleConfig | the points rule configuration XML, up to 2000 characters |
getPointsExpiryRuleTypeId()
Returns: String
Identifier of the PointsExpiryRuleType which decides when points allocated by this recognition expire. Null when the allocated points do not expire.
setPointsExpiryRuleTypeId(String pointsExpiryRuleTypeId)
Returns: void
Sets the identifier of the points expiry rule type applied to points allocated by this recognition.
| Parameter | Description |
|---|---|
pointsExpiryRuleTypeId | the points expiry rule type identifier, or null for none |
getPointsExpiryRuleConfig()
Returns: String
Configuration for the points expiry rule named by the points expiry rule type identifier, stored as XML. Up to 2000 characters, and null when the rule needs no configuration.
setPointsExpiryRuleConfig(String pointsExpiryRuleConfig)
Returns: void
Sets the XML configuration for the points expiry rule.
| Parameter | Description |
|---|---|
pointsExpiryRuleConfig | the points expiry rule configuration XML, up to 2000 characters |
getNumAwarded()
Returns: Long
Counts how many RecognitionAward rows currently exist for this badge or level. This is not a mapped column: it runs a count query against the database on every call, so avoid calling it inside a loop.
rowId()
Returns: Long
The database identifier of this badge or level, as required by the Relational interface.
Methods
asLevel()
Returns: RecognitionLevel
Narrows this recognition to a level, which a badge never is, so it always returns null. Use it together with asBadge to tell the two recognition types apart.
asBadge()
Returns: RecognitionBadge
Narrows this recognition to a badge, returning this instance. Use it on a recognition of unknown type: it returns null on the other types, so a non null result means the recognition really is a badge.
getAllowedNominators()
Returns: String
KSelector definition, held as JSON, saying who is allowed to nominate someone for this badge. Null means no restriction has been configured, so read it as a selector rather than as a list of people.
getAllowedNominees()
Returns: String
KSelector definition, held as JSON, saying who may be nominated for this badge. Null means no restriction has been configured.