Class NamedQuery


  • public class NamedQuery
    extends Object
    Target({TYPE}) @Retention(RUNTIME) public @interface NamedQuery { String name(); String query(); LockModeType lockMode() default NONE; QueryHint[] hints() default {}; }

    Java class for named-query complex type.

    The following schema fragment specifies the expected content contained within this class.

     <complexType name="named-query">
       <complexContent>
         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
           <sequence>
             <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
             <element name="query" type="{http://www.w3.org/2001/XMLSchema}string"/>
             <element name="lock-mode" type="{http://java.sun.com/xml/ns/persistence/orm}lock-mode-type" minOccurs="0"/>
             <element name="hint" type="{http://java.sun.com/xml/ns/persistence/orm}query-hint" maxOccurs="unbounded" minOccurs="0"/>
           </sequence>
           <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
         </restriction>
       </complexContent>
     </complexType>
     
    • Constructor Detail

      • NamedQuery

        public NamedQuery()
    • Method Detail

      • getDescription

        public String getDescription()
        Gets the value of the description property.
        Returns:
        possible object is String
      • setDescription

        public void setDescription​(String value)
        Sets the value of the description property.
        Parameters:
        value - allowed object is String
      • getQuery

        public String getQuery()
        Gets the value of the query property.
        Returns:
        possible object is String
      • setQuery

        public void setQuery​(String value)
        Sets the value of the query property.
        Parameters:
        value - allowed object is String
      • getLockMode

        public LockModeType getLockMode()
        Gets the value of the lockMode property.
        Returns:
        possible object is LockModeType
      • setLockMode

        public void setLockMode​(LockModeType value)
        Sets the value of the lockMode property.
        Parameters:
        value - allowed object is LockModeType
      • getHint

        public List<QueryHint> getHint()
        Gets the value of the hint property. This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the hint property. For example, to add a new item, do as follows:
            getHint().add(newItem);
         
        Objects of the following type(s) are allowed in the list QueryHint
      • getName

        public String getName()
        Gets the value of the name property.
        Returns:
        possible object is String
      • setName

        public void setName​(String value)
        Sets the value of the name property.
        Parameters:
        value - allowed object is String