Package org.eclipse.persistence.queries
Class ConstructorReportItem
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.ReportItem
-
- org.eclipse.persistence.queries.ConstructorReportItem
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class ConstructorReportItem extends org.eclipse.persistence.internal.queries.ReportItemPurpose: 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 java.lang.reflect.Constructorconstructorprotected java.lang.Class[]constructorArgTypesprotected java.util.List<DatabaseMapping>constructorMappingsprotected java.util.List<org.eclipse.persistence.internal.queries.ReportItem>reportItems
-
Constructor Summary
Constructors Constructor Description ConstructorReportItem()Create a new constructor item.ConstructorReportItem(java.lang.String name)Create a new constructor item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(java.lang.String attributeName, Expression attributeExpression, java.util.List joinedExpressions)Add the attribute with joining.voidaddAttribute(Expression attributeExpression)Method to add an expression to be used to return the parameter that is then passed into the constructor method.voidaddItem(org.eclipse.persistence.internal.queries.ReportItem item)java.lang.reflect.ConstructorgetConstructor()INTERNAL: Return the constructor.java.lang.Class[]getConstructorArgTypes()java.util.List<DatabaseMapping>getConstructorMappings()INTERNAL: Return the mappings for the items.java.util.List<org.eclipse.persistence.internal.queries.ReportItem>getReportItems()voidinitialize(ReportQuery query)INTERNAL: Looks up mapping for attribute during preExecute of ReportQuerybooleanisConstructorItem()voidsetConstructor(java.lang.reflect.Constructor constructor)INTERNAL: Set the constructor.voidsetConstructorArgTypes(java.lang.Class[] constructorArgTypes)voidsetConstructorMappings(java.util.List<DatabaseMapping> constructorMappings)INTERNAL: Return the mappings for the items.voidsetReportItems(java.util.List<org.eclipse.persistence.internal.queries.ReportItem> reportItems)java.lang.StringtoString()-
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 java.lang.Class[] constructorArgTypes
-
constructorMappings
protected java.util.List<DatabaseMapping> constructorMappings
-
reportItems
protected java.util.List<org.eclipse.persistence.internal.queries.ReportItem> reportItems
-
constructor
protected java.lang.reflect.Constructor constructor
-
-
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(java.lang.String attributeName, Expression attributeExpression, java.util.List joinedExpressions)Add the attribute with joining.
-
addItem
public void addItem(org.eclipse.persistence.internal.queries.ReportItem item)
-
getConstructorArgTypes
public java.lang.Class[] getConstructorArgTypes()
-
getConstructorMappings
public java.util.List<DatabaseMapping> getConstructorMappings()
INTERNAL: Return the mappings for the items.
-
getConstructor
public java.lang.reflect.Constructor getConstructor()
INTERNAL: Return the constructor.
-
setConstructor
public void setConstructor(java.lang.reflect.Constructor constructor)
INTERNAL: Set the constructor.
-
getReportItems
public java.util.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:
initializein classorg.eclipse.persistence.internal.queries.ReportItem- Throws:
QueryException
-
isConstructorItem
public boolean isConstructorItem()
- Overrides:
isConstructorItemin classorg.eclipse.persistence.internal.queries.ReportItem
-
setConstructorArgTypes
public void setConstructorArgTypes(java.lang.Class[] constructorArgTypes)
-
setConstructorMappings
public void setConstructorMappings(java.util.List<DatabaseMapping> constructorMappings)
INTERNAL: Return the mappings for the items.
-
setReportItems
public void setReportItems(java.util.List<org.eclipse.persistence.internal.queries.ReportItem> reportItems)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.eclipse.persistence.internal.queries.ReportItem
-
-