public class QueryDescriptor extends Object implements Serializable, ConfigurationNode, XMLSerializable
Modifier and Type | Field and Description |
---|---|
protected DataMap |
dataMap |
static String |
EJBQL_QUERY |
protected String |
name |
static String |
PROCEDURE_QUERY |
protected Map<String,String> |
properties |
protected Object |
root |
static String |
SELECT_QUERY |
static String |
SQL_TEMPLATE |
protected String |
type |
Modifier | Constructor and Description |
---|---|
protected |
QueryDescriptor(String type) |
Modifier and Type | Method and Description |
---|---|
<T> T |
acceptVisitor(ConfigurationNodeVisitor<T> visitor) |
Query |
buildQuery()
Assembles Cayenne query instance of appropriate type from this descriptor.
|
static QueryDescriptor |
descriptor(String type)
Creates query descriptor of a given type.
|
static EJBQLQueryDescriptor |
ejbqlQueryDescriptor()
Creates new EJBQLQuery query descriptor.
|
void |
encodeAsXML(XMLEncoder encoder)
Prints itself as XML to the provided XMLEncoder.
|
DataMap |
getDataMap() |
String |
getName()
Returns name of the query.
|
Map<String,String> |
getProperties()
Returns map of query properties set up for this query.
|
String |
getProperty(String name)
Returns query property by its name.
|
Object |
getRoot()
Returns the root of this query.
|
String |
getType()
Returns type of the query.
|
static ProcedureQueryDescriptor |
procedureQueryDescriptor()
Creates new ProcedureQuery query descriptor.
|
static SelectQueryDescriptor |
selectQueryDescriptor()
Creates new SelectQuery query descriptor.
|
void |
setDataMap(DataMap dataMap) |
void |
setName(String name)
Sets name of the query.
|
void |
setProperties(Map<String,String> properties)
Sets map of query properties for this query.
|
void |
setProperty(String name,
String value)
Sets single query property.
|
void |
setRoot(Object root)
Sets the root of this query.
|
void |
setType(String type)
Sets type of the query.
|
static SQLTemplateDescriptor |
sqlTemplateDescriptor()
Creates new SQLTemplate query descriptor.
|
public static final String SELECT_QUERY
public static final String SQL_TEMPLATE
public static final String EJBQL_QUERY
public static final String PROCEDURE_QUERY
protected String name
protected String type
protected DataMap dataMap
protected Object root
protected QueryDescriptor(String type)
public static SelectQueryDescriptor selectQueryDescriptor()
public static SQLTemplateDescriptor sqlTemplateDescriptor()
public static ProcedureQueryDescriptor procedureQueryDescriptor()
public static EJBQLQueryDescriptor ejbqlQueryDescriptor()
public static QueryDescriptor descriptor(String type)
public String getName()
public void setName(String name)
public String getType()
public void setType(String type)
public DataMap getDataMap()
public void setDataMap(DataMap dataMap)
public Object getRoot()
public void setRoot(Object root)
public Map<String,String> getProperties()
public void setProperties(Map<String,String> properties)
public Query buildQuery()
public <T> T acceptVisitor(ConfigurationNodeVisitor<T> visitor)
acceptVisitor
in interface ConfigurationNode
public void encodeAsXML(XMLEncoder encoder)
XMLSerializable
encodeAsXML
in interface XMLSerializable
Copyright © 2001–2018 Apache Cayenne. All rights reserved.