/* ************************************************************************
#
#  DivConq
#
#  http://divconq.com/
#
#  Copyright:
#    Copyright 2012 eTimeline, LLC. All rights reserved.
#
#  License:
#    See the license.txt file in the project's top-level directory for details.
#
#  Authors:
#    * Andy White
#
************************************************************************ */
package divconq.db;

import divconq.struct.CompositeStruct;
import divconq.struct.builder.ObjectBuilder;

/**
 * Although there are alternatives (see CustomResult) typically results from the
 * database will come in the form of a collection of java objects (a CompositeStruct).
 * This class provides a handy wrapper for this commonly used result type.
 * 
 * @author Andy
 *
 */
public class ObjectResult extends DatabaseResult {
	/**
	 * @return the collection of java objects (a CompositeStruct) assembled for a database result
	 */
	public CompositeStruct getResult() {
		return ((ObjectBuilder)this.data).getRoot();
	}

	/**
	 * Create a wrapper for database results that assembles those results into 
	 * a collection of java objects (a CompositeStruct).
	 */
	public ObjectResult() {
		super(new ObjectBuilder());
	}
}
