Class JPAStoredProcedureQuery

  • All Implemented Interfaces:
    javax.persistence.Query, javax.persistence.StoredProcedureQuery, javax.persistence.TypedQuery

    public class JPAStoredProcedureQuery
    extends JPAQuery
    implements javax.persistence.StoredProcedureQuery
    Implementation of a StoredProcedureQuery. Wraps an internal query.
    • Constructor Detail

      • JPAStoredProcedureQuery

        public JPAStoredProcedureQuery​(javax.persistence.EntityManager em,
                                       org.datanucleus.store.query.Query query)
    • Method Detail

      • setParameter

        public JPAStoredProcedureQuery setParameter​(javax.persistence.Parameter param,
                                                    Object value)
        Description copied from class: JPAQuery
        Bind the value of a Parameter object.
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
        Parameters:
        param - parameter to be set
        value - parameter value
        Returns:
        query instance
      • setParameter

        public JPAStoredProcedureQuery setParameter​(javax.persistence.Parameter param,
                                                    Calendar cal,
                                                    javax.persistence.TemporalType type)
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
      • setParameter

        public JPAStoredProcedureQuery setParameter​(javax.persistence.Parameter param,
                                                    Date date,
                                                    javax.persistence.TemporalType type)
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
      • setParameter

        public JPAStoredProcedureQuery setParameter​(String name,
                                                    Object value)
        Description copied from class: JPAQuery
        Bind an argument to a named parameter.
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
        Parameters:
        name - the parameter name
        value - The value for the param
        Returns:
        the same query instance
      • setParameter

        public JPAStoredProcedureQuery setParameter​(String name,
                                                    Calendar value,
                                                    javax.persistence.TemporalType temporalType)
        Description copied from class: JPAQuery
        Bind an instance of java.util.Calendar to a named parameter.
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
        Parameters:
        name - name of the param
        value - Value for the param
        temporalType - The temporal type
        Returns:
        the same query instance
      • setParameter

        public JPAStoredProcedureQuery setParameter​(String name,
                                                    Date date,
                                                    javax.persistence.TemporalType type)
        Description copied from class: JPAQuery
        Bind an instance of java.util.Date to a named parameter.
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
        Parameters:
        name - Name of the param
        date - Value for the param
        type - The temporal type
        Returns:
        the same query instance
      • setParameter

        public JPAStoredProcedureQuery setParameter​(int position,
                                                    Object value)
        Description copied from class: JPAQuery
        Bind an argument to a positional parameter.
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
        Parameters:
        position - Parameter position
        value - The value
        Returns:
        the same query instance
      • setParameter

        public JPAStoredProcedureQuery setParameter​(int position,
                                                    Calendar value,
                                                    javax.persistence.TemporalType temporalType)
        Description copied from class: JPAQuery
        Bind an instance of java.util.Calendar to a positional parameter.
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
        Parameters:
        position - Parameter position
        value - Value for the param
        temporalType - Temporal type
        Returns:
        the same query instance
      • setParameter

        public JPAStoredProcedureQuery setParameter​(int position,
                                                    Date value,
                                                    javax.persistence.TemporalType temporalType)
        Description copied from class: JPAQuery
        Bind an instance of java.util.Date to a positional parameter.
        Specified by:
        setParameter in interface javax.persistence.Query
        Specified by:
        setParameter in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setParameter in interface javax.persistence.TypedQuery
        Overrides:
        setParameter in class JPAQuery
        Parameters:
        position - Parameter position
        value - Value for the param
        temporalType - Temporal Type
        Returns:
        the same query instance
      • registerStoredProcedureParameter

        public javax.persistence.StoredProcedureQuery registerStoredProcedureParameter​(int position,
                                                                                       Class type,
                                                                                       javax.persistence.ParameterMode mode)
        Specified by:
        registerStoredProcedureParameter in interface javax.persistence.StoredProcedureQuery
      • registerStoredProcedureParameter

        public javax.persistence.StoredProcedureQuery registerStoredProcedureParameter​(String parameterName,
                                                                                       Class type,
                                                                                       javax.persistence.ParameterMode mode)
        Specified by:
        registerStoredProcedureParameter in interface javax.persistence.StoredProcedureQuery
      • getOutputParameterValue

        public Object getOutputParameterValue​(int position)
        Specified by:
        getOutputParameterValue in interface javax.persistence.StoredProcedureQuery
      • getOutputParameterValue

        public Object getOutputParameterValue​(String parameterName)
        Specified by:
        getOutputParameterValue in interface javax.persistence.StoredProcedureQuery
      • execute

        public boolean execute()
        Specified by:
        execute in interface javax.persistence.StoredProcedureQuery
      • hasMoreResults

        public boolean hasMoreResults()
        Specified by:
        hasMoreResults in interface javax.persistence.StoredProcedureQuery
      • getUpdateCount

        public int getUpdateCount()
        Specified by:
        getUpdateCount in interface javax.persistence.StoredProcedureQuery
      • executeUpdate

        public int executeUpdate()
        Description copied from class: JPAQuery
        Method to execute a (UPDATE/DELETE) query returning the number of changed records.
        Specified by:
        executeUpdate in interface javax.persistence.Query
        Overrides:
        executeUpdate in class JPAQuery
        Returns:
        Number of records updated/deleted with the query.
      • getResultList

        public List getResultList()
        Description copied from class: JPAQuery
        Method to execute a (SELECT) query statement returning multiple results.
        Specified by:
        getResultList in interface javax.persistence.Query
        Specified by:
        getResultList in interface javax.persistence.TypedQuery
        Overrides:
        getResultList in class JPAQuery
        Returns:
        The results
      • getSingleResult

        public Object getSingleResult()
        Description copied from class: JPAQuery
        Method to execute a SELECT statement returning a single result.
        Specified by:
        getSingleResult in interface javax.persistence.Query
        Specified by:
        getSingleResult in interface javax.persistence.TypedQuery
        Overrides:
        getSingleResult in class JPAQuery
        Returns:
        the result
      • setFlushMode

        public JPAStoredProcedureQuery setFlushMode​(javax.persistence.FlushModeType mode)
        Description copied from class: JPAQuery
        Mutator for the flush mode.
        Specified by:
        setFlushMode in interface javax.persistence.Query
        Specified by:
        setFlushMode in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setFlushMode in interface javax.persistence.TypedQuery
        Overrides:
        setFlushMode in class JPAQuery
        Parameters:
        mode - Flush mode
        Returns:
        The query
      • setHint

        public JPAStoredProcedureQuery setHint​(String hintName,
                                               Object value)
        Description copied from class: JPAQuery
        Method to add a vendor extension to the query. If the hint name is not recognized, it is silently ignored.
        Specified by:
        setHint in interface javax.persistence.Query
        Specified by:
        setHint in interface javax.persistence.StoredProcedureQuery
        Specified by:
        setHint in interface javax.persistence.TypedQuery
        Overrides:
        setHint in class JPAQuery
        Parameters:
        hintName - Name of the "hint"
        value - Value for the "hint"
        Returns:
        the same query instance