EclipseLink 1.2.0, build 'v20091016-r5565' API Reference

org.eclipse.persistence.queries
Class ConstructorReportItem

java.lang.Object
  extended by org.eclipse.persistence.internal.queries.ReportItem
      extended by org.eclipse.persistence.queries.ConstructorReportItem
All Implemented Interfaces:
java.io.Serializable, java.lang.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
protected  java.lang.reflect.Constructor constructor
           
protected  java.lang.Class[] constructorArgTypes
           
protected  java.util.List constructorMappings
           
protected  java.util.List reportItems
           
 
Fields inherited from class org.eclipse.persistence.internal.queries.ReportItem
attributeExpression, descriptor, joinedAttributeManager, mapping, name, resultIndex, resultType
 
Constructor Summary
ConstructorReportItem()
          Create a new constructor item.
ConstructorReportItem(java.lang.String name)
          Create a new constructor item.
 
Method Summary
 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()
           
 
Methods inherited from class org.eclipse.persistence.internal.queries.ReportItem
clone, getAttributeExpression, getDescriptor, getJoinedAttributeManager, getJoinedAttributeManagerInternal, getMapping, getName, getResultIndex, getResultType, hasJoining, isPlaceHolder, setDescriptor, setJoinedAttributeManager, setMapping, setResultIndex, setResultType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

constructorArgTypes

protected java.lang.Class[] constructorArgTypes

constructorMappings

protected java.util.List constructorMappings

reportItems

protected java.util.List reportItems

constructor

protected java.lang.reflect.Constructor constructor
Constructor Detail

ConstructorReportItem

public ConstructorReportItem()
Create a new constructor item.


ConstructorReportItem

public ConstructorReportItem(java.lang.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(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 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 getReportItems()

initialize

public void initialize(ReportQuery query)
                throws QueryException
INTERNAL: Looks up mapping for attribute during preExecute of ReportQuery

Overrides:
initialize in class org.eclipse.persistence.internal.queries.ReportItem
Throws:
QueryException

isConstructorItem

public boolean isConstructorItem()
Overrides:
isConstructorItem in class org.eclipse.persistence.internal.queries.ReportItem

setConstructorArgTypes

public void setConstructorArgTypes(java.lang.Class[] constructorArgTypes)

setConstructorMappings

public void setConstructorMappings(java.util.List constructorMappings)
INTERNAL: Return the mappings for the items.


setReportItems

public void setReportItems(java.util.List reportItems)

toString

public java.lang.String toString()
Overrides:
toString in class org.eclipse.persistence.internal.queries.ReportItem

EclipseLink 1.2.0, build 'v20091016-r5565' API Reference