Class Query<T>

    • Field Detail

      • FETCH

        protected static final org.hibernate.FetchMode FETCH
        imported constant for ease of use
        See Also:
        FetchMode.JOIN
      • LEFT_JOIN

        protected static final int LEFT_JOIN
        imported constant for ease of use
        See Also:
        CriteriaSpecification.LEFT_JOIN, Constant Field Values
      • INNER_JOIN

        protected static final int INNER_JOIN
        imported constant for ease of use
        See Also:
        CriteriaSpecification.INNER_JOIN, Constant Field Values
      • params

        protected final ome.parameters.Parameters params
        container of QueryParameter instances. These must at least cover all the QueryParameterDefs defined for this Query but can define more. Other special fields of Parameters, such as a Filter instance can also be used by Query instances.
      • newlyEnabledFilters

        protected java.util.Set<java.lang.String> newlyEnabledFilters
        the set of filters that is being or has been enabled for this Query.
    • Constructor Detail

      • Query

        public Query​(Definitions definitions,
                     ome.parameters.Parameters parameters)
        main constructor used by subclasses. Both arguments must be provided.
        Parameters:
        definitions - Not null.
        parameters - Not null.
    • Method Detail

      • checkParameters

        protected void checkParameters()
        check the Parameters instance against the Definitions instance for this Query. Can be extended by subclasses, but super.checkParameters() should most likely be called.
      • check

        public boolean check​(java.lang.String name)
        check that there is a definition for this Query with the provided argument as its name.
      • value

        public java.lang.Object value​(java.lang.String name)
        get the Object value for this name argument. Returns null even if no QueryParameter is associated with the name (no exception).
      • setTimeout

        public void setTimeout​(int seconds)
        Parameters:
        seconds - the timeout to set
      • enableFilters

        protected void enableFilters​(org.hibernate.Session session)
        does nothing by default, but can be overridden by subclasses to enable particular filters.
      • ownerOrGroupFilters

        protected void ownerOrGroupFilters​(org.hibernate.Session session,
                                           java.lang.String[] ownerFilters,
                                           java.lang.String[] groupFilters)
        standard filter used by many subclasses which uses the Parameters.isExperimenter() and Parameters.isGroup() booleans to see if a filter should be turned on. If both booleans are active, group wins. The constant Parameters.OWNER_ID or Parameters.GROUP_ID is then used to define a filter.
      • enableQueryCache

        public Query<T> enableQueryCache()
        Enable the Hibernate level 2 cache for this query.
        Returns:
        this instance, for method chaining
      • disableQueryCache

        public Query<T> disableQueryCache()
        Disable the Hibernate level 2 cache for this query.
        Returns:
        this instance, for method chaining