public class ConstructorReportItem
extends org.eclipse.persistence.internal.queries.ReportItem
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.
Modifier and Type | Field and Description |
---|---|
protected java.lang.reflect.Constructor |
constructor |
protected java.lang.Class[] |
constructorArgTypes |
protected java.util.List |
constructorMappings |
protected java.util.List |
reportItems |
Constructor and Description |
---|
ConstructorReportItem()
Create a new constructor item.
|
ConstructorReportItem(java.lang.String name)
Create a new constructor item.
|
Modifier and Type | Method and Description |
---|---|
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 |
addAttribute(java.lang.String attributeName,
Expression attributeExpression,
java.util.List joinedExpressions)
Add the attribute with joining.
|
void |
addItem(org.eclipse.persistence.internal.queries.ReportItem item) |
java.lang.reflect.Constructor |
getConstructor()
INTERNAL:
Return the constructor.
|
java.lang.Class[] |
getConstructorArgTypes() |
java.util.List |
getConstructorMappings()
INTERNAL:
Return the mappings for the items.
|
java.util.List |
getReportItems() |
void |
initialize(ReportQuery query)
INTERNAL:
Looks up mapping for attribute during preExecute of ReportQuery
|
boolean |
isConstructorItem() |
void |
setConstructor(java.lang.reflect.Constructor constructor)
INTERNAL:
Set the constructor.
|
void |
setConstructorArgTypes(java.lang.Class[] constructorArgTypes) |
void |
setConstructorMappings(java.util.List constructorMappings)
INTERNAL:
Return the mappings for the items.
|
void |
setReportItems(java.util.List reportItems) |
java.lang.String |
toString() |
clone, getAttributeExpression, getDescriptor, getJoinedAttributeManager, getJoinedAttributeManagerInternal, getMapping, getName, getResultIndex, getResultType, hasJoining, isPlaceHolder, setAttributeExpression, setDescriptor, setJoinedAttributeManager, setMapping, setResultIndex, setResultType
protected java.lang.Class[] constructorArgTypes
protected java.util.List constructorMappings
protected java.util.List reportItems
protected java.lang.reflect.Constructor constructor
public ConstructorReportItem()
public ConstructorReportItem(java.lang.String name)
name
- string used to look up this result in the ReportQueryResult.public void addAttribute(Expression attributeExpression)
public void addAttribute(java.lang.String attributeName, Expression attributeExpression, java.util.List joinedExpressions)
public void addItem(org.eclipse.persistence.internal.queries.ReportItem item)
public java.lang.Class[] getConstructorArgTypes()
public java.util.List getConstructorMappings()
public java.lang.reflect.Constructor getConstructor()
public void setConstructor(java.lang.reflect.Constructor constructor)
public java.util.List getReportItems()
public void initialize(ReportQuery query) throws QueryException
initialize
in class org.eclipse.persistence.internal.queries.ReportItem
QueryException
public boolean isConstructorItem()
isConstructorItem
in class org.eclipse.persistence.internal.queries.ReportItem
public void setConstructorArgTypes(java.lang.Class[] constructorArgTypes)
public void setConstructorMappings(java.util.List constructorMappings)
public void setReportItems(java.util.List reportItems)
public java.lang.String toString()
toString
in class org.eclipse.persistence.internal.queries.ReportItem