Class ConstructorReportItem

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class ConstructorReportItem
    extends 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.

    Since:
    TopLink Essentials 1.0
    Author:
    Chris Delahunt
    See Also:
    Serialized Form
    • 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​(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.
      • 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<ReportItem> reportItems)