private <T extends ObjectFilter> Restriction findAndCreateRestriction( T filter, InterpretationContext context, Restriction parent) throws QueryException { Validate.notNull(filter, "filter"); Validate.notNull(context, "context"); LOGGER.trace("Determining restriction for filter {}", filter); ItemPathResolver helper = context.getItemPathResolver(); JpaEntityDefinition baseEntityDefinition; if (parent != null) { baseEntityDefinition = parent.getBaseHqlEntityForChildren().getJpaDefinition(); } else { baseEntityDefinition = context.getRootEntityDefinition(); } Restriction restriction = findAndCreateRestrictionInternal(filter, context, parent, helper, baseEntityDefinition); LOGGER.trace("Restriction for {} is {}", filter.getClass().getSimpleName(), restriction); return restriction; }
public <T extends Object> Matcher<T> findMatcher(T value) { return findMatcher(value != null ? (Class<T>) value.getClass() : null); }