org.eclipse.jpt.jpa.core.context
Interface Query

All Superinterfaces:
org.eclipse.core.runtime.IAdaptable, IResourcePart, JpaContextNode, JpaNamedContextNode<Query>, JpaNode, Model
All Known Subinterfaces:
JavaNamedNativeQuery, JavaNamedQuery, JavaNamedQuery2_0, JavaQuery, NamedNativeQuery, NamedQuery, NamedQuery2_0, OrmNamedNativeQuery, OrmNamedQuery, OrmNamedQuery2_0, OrmQuery

public interface Query
extends JpaNamedContextNode<Query>

Named and named native queries.

Queries can be defined on

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Since:
2.0
Version:
2.2

Field Summary
static java.lang.String HINTS_LIST
           
static java.lang.Iterable<java.lang.Class<? extends Query>> PRECEDENCE_TYPE_LIST
          TODO use this precedence until adopters protest...
static java.lang.String QUERY_PROPERTY
           
 
Fields inherited from interface org.eclipse.jpt.jpa.core.context.JpaNamedContextNode
NAME_PROPERTY
 
Method Summary
 QueryHint addHint()
          Add a hint to the query and return the object representing it.
 QueryHint addHint(int index)
          Add a hint to the query and return the object representing it.
<T extends QueryHint>
org.eclipse.jpt.common.utility.internal.iterables.ListIterable<T>
getHints()
          Return the query's hints.
 int getHintsSize()
          Return the number of hints.
 java.lang.String getQuery()
           
 void moveHint(int targetIndex, int sourceIndex)
          Move the hint from the source index to the target index.
 void removeHint(int index)
          Remove the hint from the query.
 void removeHint(QueryHint queryHint)
          Remove the hint at the index from the query.
 void setQuery(java.lang.String query)
           
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaNamedContextNode
duplicates, getName, overrides, setName
 
Methods inherited from interface org.eclipse.jpt.jpa.core.context.JpaContextNode
getContextDefaultDbCatalog, getContextDefaultDbSchema, getContextDefaultDbSchemaContainer, getMappingFileRoot, getPersistenceUnit, getResourceType, synchronizeWithResourceModel, update
 
Methods inherited from interface org.eclipse.jpt.jpa.core.JpaNode
getJpaProject, getParent, stateChanged
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, addTreeChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener, removeTreeChangeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.jpt.common.core.IResourcePart
getResource
 

Field Detail

PRECEDENCE_TYPE_LIST

static final java.lang.Iterable<java.lang.Class<? extends Query>> PRECEDENCE_TYPE_LIST
TODO use this precedence until adopters protest... then move to JpaPlatform


QUERY_PROPERTY

static final java.lang.String QUERY_PROPERTY
See Also:
Constant Field Values

HINTS_LIST

static final java.lang.String HINTS_LIST
See Also:
Constant Field Values
Method Detail

getQuery

java.lang.String getQuery()

setQuery

void setQuery(java.lang.String query)

getHints

<T extends QueryHint> org.eclipse.jpt.common.utility.internal.iterables.ListIterable<T> getHints()
Return the query's hints.


getHintsSize

int getHintsSize()
Return the number of hints.


addHint

QueryHint addHint()
Add a hint to the query and return the object representing it.


addHint

QueryHint addHint(int index)
Add a hint to the query and return the object representing it.


removeHint

void removeHint(QueryHint queryHint)
Remove the hint at the index from the query.


removeHint

void removeHint(int index)
Remove the hint from the query.


moveHint

void moveHint(int targetIndex,
              int sourceIndex)
Move the hint from the source index to the target index.