Top Description Fields Constructors Methods
org.eclipse.persistence.queries

public Class ConstructorReportItem

extends ReportItem
Class Inheritance
Imports
java.lang.reflect.Constructor, java.security.AccessController, .PrivilegedActionException, java.util.ArrayList, .List, .Map, org.eclipse.persistence.exceptions.QueryException, org.eclipse.persistence.expressions.Expression, org.eclipse.persistence.internal.expressions.ConstantExpression, .MapEntryExpression, org.eclipse.persistence.internal.helper.ClassConstants, .StringHelper, org.eclipse.persistence.internal.queries.ReportItem, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedGetConstructorFor, org.eclipse.persistence.mappings.DatabaseMapping

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.

Author
Chris Delahunt
Since
TopLink Essentials 1.0

Field Summary

Modifier and TypeField and Description
protected Constructor<T>
protected Class<?>[]
protected List<DatabaseMapping>
protected List<ReportItem>
private static final String
TO_STR_ARRAY

String to separate name and items array of toString() output.

private static final String
TO_STR_PREFIX

String prefix of toString() output.

private static final String
TO_STR_SUFFIX

String suffix of toString() output.

Inherited from org.eclipse.persistence.internal.queries.ReportItem:
attributeExpressiondescriptorjoinedAttributeManagermappingnameresultIndexresultType

Constructor Summary

AccessConstructor and Description
public
ConstructorReportItem()

Create a new constructor item.

public
ConstructorReportItem(String
string used to look up this result in the ReportQueryResult.
name
)

Create a new constructor item.

Method Summary

Modifier and TypeMethod and Description
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.

public void
addAttribute(String attributeName, Expression attributeExpression, List<E> joinedExpressions)

Add the attribute with joining.

public void
public Constructor<T>
getConstructor()

INTERNAL: Return the constructor.

public Class<?>[]
public List<DatabaseMapping>
getConstructorMappings()

INTERNAL: Return the mappings for the items.

public List<ReportItem>
public void
initialize(ReportQuery query)

Overrides org.eclipse.persistence.internal.queries.ReportItem.initialize.

INTERNAL: Looks up mapping for attribute during preExecute of ReportQuery
public boolean
public void
setConstructor(Constructor<T> constructor)

INTERNAL: Set the constructor.

public void
setConstructorArgTypes(Class<?>[] constructorArgTypes)

public void
setConstructorMappings(List<DatabaseMapping> constructorMappings)

INTERNAL: Return the mappings for the items.

public void
public String
toString()

Overrides org.eclipse.persistence.internal.queries.ReportItem.toString.

Returns a string representation of the object.
Inherited from org.eclipse.persistence.internal.queries.ReportItem:
clonegetAttributeExpressiongetDescriptorgetJoinedAttributeManagergetJoinedAttributeManagerInternalgetMappinggetNamegetResultIndexgetResultTypehasJoiningsetAttributeExpressionsetDescriptorsetJoinedAttributeManagersetMappingsetResultIndexsetResultType

Field Detail

constructorback to summary
protected Constructor<T> constructor
constructorArgTypesback to summary
protected Class<?>[] constructorArgTypes
constructorMappingsback to summary
protected List<DatabaseMapping> constructorMappings
reportItemsback to summary
protected List<ReportItem> reportItems
TO_STR_ARRAYback to summary
private static final String TO_STR_ARRAY

String to separate name and items array of toString() output.

TO_STR_PREFIXback to summary
private static final String TO_STR_PREFIX

String prefix of toString() output.

TO_STR_SUFFIXback to summary
private static final String TO_STR_SUFFIX

String suffix of toString() output.

Constructor Detail

ConstructorReportItemback to summary
public ConstructorReportItem()

Create a new constructor item.

ConstructorReportItemback to summary
public ConstructorReportItem(String name)

Create a new constructor item.

Parameters
name:String

string used to look up this result in the ReportQueryResult.

Method Detail

addAttributeback to summary
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.

addAttributeback to summary
public void addAttribute(String attributeName, Expression attributeExpression, List<E> joinedExpressions)

Add the attribute with joining.

addItemback to summary
public void addItem(ReportItem item)
getConstructorback to summary
public Constructor<T> getConstructor()

INTERNAL: Return the constructor.

getConstructorArgTypesback to summary
public Class<?>[] getConstructorArgTypes()
getConstructorMappingsback to summary
public List<DatabaseMapping> getConstructorMappings()

INTERNAL: Return the mappings for the items.

getReportItemsback to summary
public List<ReportItem> getReportItems()
initializeback to summary
public void initialize(ReportQuery query) throws QueryException

Overrides org.eclipse.persistence.internal.queries.ReportItem.initialize.

INTERNAL: Looks up mapping for attribute during preExecute of ReportQuery

Annotations
@Override
isConstructorItemback to summary
public boolean isConstructorItem()

Overrides org.eclipse.persistence.internal.queries.ReportItem.isConstructorItem.

Annotations
@Override
setConstructorback to summary
public void setConstructor(Constructor<T> constructor)

INTERNAL: Set the constructor.

setConstructorArgTypesback to summary
public void setConstructorArgTypes(Class<?>[] constructorArgTypes)
setConstructorMappingsback to summary
public void setConstructorMappings(List<DatabaseMapping> constructorMappings)

INTERNAL: Return the mappings for the items.

setReportItemsback to summary
public void setReportItems(List<ReportItem> reportItems)
toStringback to summary
public String toString()

Overrides org.eclipse.persistence.internal.queries.ReportItem.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override