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

PropertyReturnsDescription
allowedNominatorsStringKSelector 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.
allowedNomineesStringKSelector definition, held as JSON, saying who may be nominated for this badge. Null means no restriction has been configured.

Inherited from BaseRecognition

Properties

PropertyReturnsDescription
adminDomainOrganisationThe administrative organisation this recognition was defined in. Loaded lazily.
assetIdStringIdentifier of an asset library item linked to this recognition, used as an alternative to an uploaded image. Null when no asset is linked.
colourStringDisplay colour for this badge or level, as entered in the admin UI, typically a CSS colour value. Null when no colour has been chosen.
field1StringFirst 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.
field2StringSecond general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue.
field3StringThird general purpose custom field, free text, available for account specific data. On a level it can also be read by name through fieldValue.
idlongThe database identifier of this badge or level.
imageHashStringHash of the badge or level image held in the blob store, used to render the artwork. Null when no image has been uploaded.
nameStringPortable, 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.
numAwardedLongCounts 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.
numPointsDoubleFixed 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.
pointsBucketRewardThe 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.
pointsExpiryRuleConfigStringConfiguration 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.
pointsExpiryRuleTypeIdStringIdentifier of the PointsExpiryRuleType which decides when points allocated by this recognition expire. Null when the allocated points do not expire.
pointsReasonStringCustom 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.
pointsRuleConfigStringConfiguration 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.
pointsRuleTypeIdStringIdentifier 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.
pointsTagPointsTagOptional 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.
titleStringFree-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.
topicRecognitionTopicThe 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.
typeStringDiscriminator 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.

ParameterDescription
typethe 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.

ParameterDescription
adminDomainthe 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.

ParameterDescription
topicthe 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.

ParameterDescription
pointsTagthe 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.

ParameterDescription
pointsReasonthe 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.

ParameterDescription
namethe 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.

ParameterDescription
titlethe 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.

ParameterDescription
imageHashthe 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.

ParameterDescription
colourthe 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.

ParameterDescription
assetIdthe 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.

ParameterDescription
field1the 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.

ParameterDescription
field2the 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.

ParameterDescription
field3the 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.

ParameterDescription
pointsBucketthe 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.

ParameterDescription
numPointsthe 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.

ParameterDescription
pointsRuleTypeIdthe 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.

ParameterDescription
pointsRuleConfigthe 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.

ParameterDescription
pointsExpiryRuleTypeIdthe 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.

ParameterDescription
pointsExpiryRuleConfigthe 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.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.