NamedQueryView Interface
An interface named atg.repository.NamedQueryView
provides methods to create and access named queries. This interface extends atg.repository.RepositoryView
. It includes the following methods:
public void createNamedQuery(String pQueryName, Query pQuery)
Creates an association in the RepositoryView
between a name and a Query
object. After this association is created, you can call getNamedQuery
to get the Query
object to be used for execution. If this method is called with a pQueryName
that has already been assigned a Query
, then the existing Query
will be overwritten with the new Query
.
public Query getNamedQuery(String pQueryName)
Gets the Query
object associated with the given name. If no such entry has been created for the given String, then null is returned.
public String[] getNamedQueryNames()
Returns the names of all Named Queries that this RepositoryView
knows about, or null if there are none.
public QueryDescriptor getQueryDescriptor(String pQueryName)
Returns a QueryDescriptor
object that describes aspects of the requested NamedQuery
. If there is no named query by the given name, null is returned.
public String getQueryName(Query pQuery)
Returns the name of the given Query
, if any exists. Otherwise, null is returned.
QueryDescriptor
The atg.repository.QueryDescriptor
interface defines methods for an object that describes a Repository Query and associates a Repository Query object with a user-defined String name. It defines the following methods:
public Query getQuery()
public String getQueryName()
The atg.repository.query.QueryDescriptorImpl
class is the base implementation of the QueryDescriptor
interface and the atg.adapter.gsa.query.GSAQueryDescriptor
class is the SQL repository’s subclass of QueryDescriptorImpl
.
RepositoryViewImpl
The atg.repository.RepositoryViewImpl
class implements NamedQueryView
and supports the use of named queries.