Registry of KCriteriaBuilder instances, one per persistent entity type, exposed to server-side JS and Velocity as services.criteriaBuilders for building organisation-scoped Hibernate criteria queries. Populated once at construction with a fixed set of entity mappings, each giving the entity class, its required join associations, and the property used to restrict results to the current admin organisation. A caller looks up a builder by registered name (services.criteriaBuilders.get("product")) or by entity class, then uses it to build a KCriteria, instantiate a new entity, or save or delete an existing one, without constructing Hibernate criteria or handling organisation scoping directly. Background on the original design is in issue 5404 of the kademi-dev repository.

Group: Managers


Properties

PropertyReturnsDescription
buildersList<KCriteriaBuilder>All registered KCriteriaBuilder instances, sorted alphabetically by name.
pointsKCriteriaShortcut for get("points") - a freshly built KCriteria for querying Points records within the current organisation.
pointsDebitKCriteriaShortcut for get("pointsDebit") - a freshly built KCriteria for querying PointsDebit records within the current organisation.
profileKCriteriaShortcut for get("profile") - a freshly built KCriteria for querying Profile records within the current organisation.

Methods

getByClass(Class c) · forObject(Object o) · getPoints() · getProfile() · getPointsDebit() · get(String name) · getBuilder(String name) · searchProps(int startPos, int pageSize) · getBuilders()

getByClass(Class c)

Returns: KCriteriaBuilder

Looks up the builder registered for the given entity class.

ParameterDescription
cthe entity class to find a builder for

forObject(Object o)

Returns: KCriteriaBuilder

Looks up the KCriteriaBuilder registered for the given object's entity class, unwrapping any Hibernate proxy first so a subclassed or enhanced instance still resolves to its base entity type.

ParameterDescription
othe entity instance to find a builder for, or null

getPoints()

Returns: KCriteria

Shortcut for get("points") - a freshly built KCriteria for querying Points records within the current organisation.

getProfile()

Returns: KCriteria

Shortcut for get("profile") - a freshly built KCriteria for querying Profile records within the current organisation.

getPointsDebit()

Returns: KCriteria

Shortcut for get("pointsDebit") - a freshly built KCriteria for querying PointsDebit records within the current organisation.

get(String name)

Returns: KCriteria

Looks up the builder registered under the given name and builds a fresh, organisation-scoped KCriteria from it. Logs and returns null, rather than throwing, when no builder is registered for that name.

ParameterDescription
namethe registered builder name, e.g. "product" or "profile"

getBuilder(String name)

Returns: KCriteriaBuilder

Looks up the raw KCriteriaBuilder registered under the given name, without building a KCriteria from it.

ParameterDescription
namethe registered builder name, e.g. "product" or "profile"

searchProps(int startPos, int pageSize)

Returns: SearchProperties

Creates a SearchProperties describing a page of results, for use with paged criteria searches.

ParameterDescription
startPosthe zero-based index of the first record to return
pageSizethe maximum number of records to return

getBuilders()

Returns: List<KCriteriaBuilder>

All registered KCriteriaBuilder instances, sorted alphabetically by name.

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