org.jboss.shrinkwrap.descriptor.impl.ejbjar31
Class QueryTypeImpl<T>

java.lang.Object
  extended by org.jboss.shrinkwrap.descriptor.impl.ejbjar31.QueryTypeImpl<T>
All Implemented Interfaces:
org.jboss.shrinkwrap.descriptor.api.Child<T>, QueryType<T>

public class QueryTypeImpl<T>
extends java.lang.Object
implements org.jboss.shrinkwrap.descriptor.api.Child<T>, QueryType<T>

This class implements the queryType xsd type

Original Documentation:



The queryType defines a finder or select
query. It contains
- an optional description of the query
- the specification of the finder or select
method it is used by
- an optional specification of the result type
mapping, if the query is for a select method
and entity objects are returned.
- the EJB QL query string that defines the query.

Queries that are expressible in EJB QL must use the ejb-ql
element to specify the query. If a query is not expressible
in EJB QL, the description element should be used to
describe the semantics of the query and the ejb-ql element
should be empty.

The result-type-mapping is an optional element. It can only
be present if the query-method specifies a select method
that returns entity objects. The default value for the
result-type-mapping element is "Local".


Since:
Generation date :2011-07-19T22:55:02.759+02:00
Author:
Ralf Battenfeld

Constructor Summary
QueryTypeImpl(T t, java.lang.String nodeName, org.jboss.shrinkwrap.descriptor.spi.Node node)
           
QueryTypeImpl(T t, java.lang.String nodeName, org.jboss.shrinkwrap.descriptor.spi.Node node, org.jboss.shrinkwrap.descriptor.spi.Node childNode)
           
 
Method Summary
 java.lang.String getDescription()
          Returns the description element
 java.lang.String getEjbQl()
          Returns the ejb-ql element
 ResultTypeMappingType getResultTypeMapping()
          Returns the result-type-mapping element
 java.lang.String getResultTypeMappingAsString()
          Returns the result-type-mapping element
 QueryMethodType<QueryType<T>> queryMethod()
          If not already created, a new query-method element will be created and returned.
 QueryType<T> removeDescription()
          Removes the description element
 QueryType<T> removeEjbQl()
          Removes the ejb-ql element
 QueryType<T> removeQueryMethod()
          Removes the query-method element
 QueryType<T> setDescription(java.lang.String description)
          If not already created, a new description element with the given value will be created.
 QueryType<T> setEjbQl(java.lang.String ejbQl)
          If not already created, a new ejb-ql element with the given value will be created.
 QueryType<T> setResultTypeMapping(ResultTypeMappingType resultTypeMapping)
          If not already created, a new result-type-mapping element with the given value will be created.
 QueryType<T> setResultTypeMapping(java.lang.String resultTypeMapping)
          If not already created, a new result-type-mapping element with the given value will be created.
 T up()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryTypeImpl

public QueryTypeImpl(T t,
                     java.lang.String nodeName,
                     org.jboss.shrinkwrap.descriptor.spi.Node node)

QueryTypeImpl

public QueryTypeImpl(T t,
                     java.lang.String nodeName,
                     org.jboss.shrinkwrap.descriptor.spi.Node node,
                     org.jboss.shrinkwrap.descriptor.spi.Node childNode)
Method Detail

up

public T up()
Specified by:
up in interface org.jboss.shrinkwrap.descriptor.api.Child<T>

setDescription

public QueryType<T> setDescription(java.lang.String description)
If not already created, a new description element with the given value will be created. Otherwise, the existing description element will be updated with the given value.

Specified by:
setDescription in interface QueryType<T>
Returns:
the current instance of QueryType

removeDescription

public QueryType<T> removeDescription()
Removes the description element

Specified by:
removeDescription in interface QueryType<T>
Returns:
the current instance of QueryType

getDescription

public java.lang.String getDescription()
Returns the description element

Specified by:
getDescription in interface QueryType<T>
Returns:
the node defined for the element description

removeQueryMethod

public QueryType<T> removeQueryMethod()
Removes the query-method element

Specified by:
removeQueryMethod in interface QueryType<T>
Returns:
the current instance of QueryType

queryMethod

public QueryMethodType<QueryType<T>> queryMethod()
If not already created, a new query-method element will be created and returned. Otherwise, the existing query-method element will be returned.

Specified by:
queryMethod in interface QueryType<T>
Returns:
the node defined for the element query-method

setResultTypeMapping

public QueryType<T> setResultTypeMapping(ResultTypeMappingType resultTypeMapping)
If not already created, a new result-type-mapping element with the given value will be created. Otherwise, the existing result-type-mapping element will be updated with the given value.

Specified by:
setResultTypeMapping in interface QueryType<T>
Returns:
the current instance of QueryType

setResultTypeMapping

public QueryType<T> setResultTypeMapping(java.lang.String resultTypeMapping)
If not already created, a new result-type-mapping element with the given value will be created. Otherwise, the existing result-type-mapping element will be updated with the given value.

Specified by:
setResultTypeMapping in interface QueryType<T>
Returns:
the current instance of QueryType

getResultTypeMapping

public ResultTypeMappingType getResultTypeMapping()
Returns the result-type-mapping element

Specified by:
getResultTypeMapping in interface QueryType<T>
Returns:
the node defined for the element result-type-mapping

getResultTypeMappingAsString

public java.lang.String getResultTypeMappingAsString()
Returns the result-type-mapping element

Specified by:
getResultTypeMappingAsString in interface QueryType<T>
Returns:
the node defined for the element result-type-mapping

setEjbQl

public QueryType<T> setEjbQl(java.lang.String ejbQl)
If not already created, a new ejb-ql element with the given value will be created. Otherwise, the existing ejb-ql element will be updated with the given value.

Specified by:
setEjbQl in interface QueryType<T>
Returns:
the current instance of QueryType

removeEjbQl

public QueryType<T> removeEjbQl()
Removes the ejb-ql element

Specified by:
removeEjbQl in interface QueryType<T>
Returns:
the current instance of QueryType

getEjbQl

public java.lang.String getEjbQl()
Returns the ejb-ql element

Specified by:
getEjbQl in interface QueryType<T>
Returns:
the node defined for the element ejb-ql