Package org.eclipse.persistence.queries
Class ConstructorReportItem
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.ReportItem
-
- org.eclipse.persistence.queries.ConstructorReportItem
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class ConstructorReportItem extends org.eclipse.persistence.internal.queries.ReportItem
Purpose: An item specifying a class constructor method to be used in a ReportQuery's returned results.Example:
ConstructorReportItem item = new ConstructorReportItem("Employee"); item.setResultType(Employee.class); item.addAttribute("firstName", employees.get("firstName")); query.addConstructorReportItem(item);
When executed will return a collection of ReportQueryResults that contain Employee objects created using the new Employee(firstname) constructor.
- See Also:
- Serialized Form
- Author:
- Chris Delahunt
- Since:
- TopLink Essentials 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected Constructor
constructor
protected Class[]
constructorArgTypes
protected List<DatabaseMapping>
constructorMappings
protected List<org.eclipse.persistence.internal.queries.ReportItem>
reportItems
-
Constructor Summary
Constructors Constructor Description ConstructorReportItem()
Create a new constructor item.ConstructorReportItem(String name)
Create a new constructor item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(String attributeName, Expression attributeExpression, List joinedExpressions)
Add the attribute with joining.void
addAttribute(Expression attributeExpression)
Method to add an expression to be used to return the parameter that is then passed into the constructor method.void
addItem(org.eclipse.persistence.internal.queries.ReportItem item)
Constructor
getConstructor()
INTERNAL: Return the constructor.Class[]
getConstructorArgTypes()
List<DatabaseMapping>
getConstructorMappings()
INTERNAL: Return the mappings for the items.List<org.eclipse.persistence.internal.queries.ReportItem>
getReportItems()
void
initialize(ReportQuery query)
INTERNAL: Looks up mapping for attribute during preExecute of ReportQueryboolean
isConstructorItem()
void
setConstructor(Constructor constructor)
INTERNAL: Set the constructor.void
setConstructorArgTypes(Class[] constructorArgTypes)
void
setConstructorMappings(List<DatabaseMapping> constructorMappings)
INTERNAL: Return the mappings for the items.void
setReportItems(List<org.eclipse.persistence.internal.queries.ReportItem> reportItems)
String
toString()
-
Methods inherited from class org.eclipse.persistence.internal.queries.ReportItem
clone, getAttributeExpression, getDescriptor, getJoinedAttributeManager, getJoinedAttributeManagerInternal, getMapping, getName, getResultIndex, getResultType, hasJoining, setAttributeExpression, setDescriptor, setJoinedAttributeManager, setMapping, setResultIndex, setResultType
-
-
-
-
Field Detail
-
constructorArgTypes
protected Class[] constructorArgTypes
-
constructorMappings
protected List<DatabaseMapping> constructorMappings
-
reportItems
protected List<org.eclipse.persistence.internal.queries.ReportItem> reportItems
-
constructor
protected Constructor constructor
-
-
Constructor Detail
-
ConstructorReportItem
public ConstructorReportItem()
Create a new constructor item.
-
ConstructorReportItem
public ConstructorReportItem(String name)
Create a new constructor item.- Parameters:
name
- string used to look up this result in the ReportQueryResult.
-
-
Method Detail
-
addAttribute
public void addAttribute(Expression attributeExpression)
Method to add an expression to be used to return the parameter that is then passed into the constructor method. Similar to ReportQuery's addAttribute method, but name is not needed.
-
addAttribute
public void addAttribute(String attributeName, Expression attributeExpression, List joinedExpressions)
Add the attribute with joining.
-
addItem
public void addItem(org.eclipse.persistence.internal.queries.ReportItem item)
-
getConstructorArgTypes
public Class[] getConstructorArgTypes()
-
getConstructorMappings
public List<DatabaseMapping> getConstructorMappings()
INTERNAL: Return the mappings for the items.
-
getConstructor
public Constructor getConstructor()
INTERNAL: Return the constructor.
-
setConstructor
public void setConstructor(Constructor constructor)
INTERNAL: Set the constructor.
-
getReportItems
public List<org.eclipse.persistence.internal.queries.ReportItem> getReportItems()
-
initialize
public void initialize(ReportQuery query) throws QueryException
INTERNAL: Looks up mapping for attribute during preExecute of ReportQuery- Overrides:
initialize
in classorg.eclipse.persistence.internal.queries.ReportItem
- Throws:
QueryException
-
isConstructorItem
public boolean isConstructorItem()
- Overrides:
isConstructorItem
in classorg.eclipse.persistence.internal.queries.ReportItem
-
setConstructorArgTypes
public void setConstructorArgTypes(Class[] constructorArgTypes)
-
setConstructorMappings
public void setConstructorMappings(List<DatabaseMapping> constructorMappings)
INTERNAL: Return the mappings for the items.
-
setReportItems
public void setReportItems(List<org.eclipse.persistence.internal.queries.ReportItem> reportItems)
-
toString
public String toString()
- Overrides:
toString
in classorg.eclipse.persistence.internal.queries.ReportItem
-
-