Class QuerySingleResolverStrategy
java.lang.Object
ch.tocco.nice2.persist.entity.api.defaultvalue.QueryResolverStrategy
ch.tocco.nice2.persist.entity.impl.defaultvalue.QuerySingleResolverStrategy
- All Implemented Interfaces:
DefaultValueResolverStrategy
Resolves the 'singlequery' default value. It selects the only element for a
relation. That applies only if there is exactly one element in the option list.
-
Field Summary
Fields inherited from interface ch.tocco.nice2.model.base.spi.defaultvalue.spi.DefaultValueResolverStrategy
CURRENT_PRINCIPAL_VAL, CURRENT_USER_VAL, PRINCIPAL_ENTITY, USER_ENTITY
-
Constructor Summary
ConstructorDescriptionQuerySingleResolverStrategy
(QueryBuilderFactory queryBuilderFactory, NiceDataModel dataModel) -
Method Summary
Modifier and TypeMethodDescriptiongetResolvedValue
(DefaultValueDescriptor defaultValue) Return the display value that is presented to end users.getType()
boolean
isResolvable
(DefaultValueDescriptor descriptor) Checks whether this strategy is capable of resolving the given descriptor.Methods inherited from class ch.tocco.nice2.persist.entity.api.defaultvalue.QueryResolverStrategy
executeQuery, getTargetEntity
-
Constructor Details
-
QuerySingleResolverStrategy
public QuerySingleResolverStrategy(@Lazy QueryBuilderFactory queryBuilderFactory, NiceDataModel dataModel)
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceDefaultValueResolverStrategy
- Overrides:
getType
in classQueryResolverStrategy
-
isResolvable
Description copied from interface:DefaultValueResolverStrategy
Checks whether this strategy is capable of resolving the given descriptor.- Specified by:
isResolvable
in interfaceDefaultValueResolverStrategy
- Overrides:
isResolvable
in classQueryResolverStrategy
-
getResolvedValue
public SingleQueryValue getResolvedValue(DefaultValueDescriptor defaultValue) throws ResolvingException Description copied from interface:DefaultValueResolverStrategy
Return the display value that is presented to end users.- Specified by:
getResolvedValue
in interfaceDefaultValueResolverStrategy
- Overrides:
getResolvedValue
in classQueryResolverStrategy
- Throws:
ResolvingException
-