org.apache.openjpa.kernel
Class ResultPacker

java.lang.Object
  extended by org.apache.openjpa.kernel.ResultPacker
Direct Known Subclasses:
ResultShapePacker

public class ResultPacker
extends Object

Helper class to pack results into the result class set on the query.

Author:
Abe White, Patrick Linskey

Constructor Summary
protected ResultPacker()
          Protected constructor to bypass this implementation but allow extension.
  ResultPacker(Class[] types, String[] aliases, Class resultClass)
          Constructor for standard projection.
  ResultPacker(Class candidate, String alias, Class resultClass)
          Constructor for result class without a projection.
 
Method Summary
 Object pack(Object result)
          Pack the given object into an instance of the query's result class.
 Object pack(Object[] result)
          Pack the given array into an instance of the query's result class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultPacker

protected ResultPacker()
Protected constructor to bypass this implementation but allow extension.


ResultPacker

public ResultPacker(Class candidate,
                    String alias,
                    Class resultClass)
Constructor for result class without a projection.


ResultPacker

public ResultPacker(Class[] types,
                    String[] aliases,
                    Class resultClass)
Constructor for standard projection.

Parameters:
types - the projection value types
aliases - the alias for each projection value
resultClass - the class to pack into
Method Detail

pack

public Object pack(Object result)
Pack the given object into an instance of the query's result class.


pack

public Object pack(Object[] result)
Pack the given array into an instance of the query's result class.



Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.