Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (C) 2012 Clarion Media, LLC
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package com.clarionmedia.infinitum.orm;

This interface provides an API for creating new instances of model classes from ORM query results. It's important to note that model classes must contain an empty, parameterless constructor in order for these methods to work since java.lang.Object construction is done using reflection. If no such constructor is present, a com.clarionmedia.infinitum.orm.exception.ModelConfigurationException will be thrown at runtime.

Tyler Treat
1.0 02/20/12
public interface ModelFactory {

Constructs a domain model instance and populates its fields from the given ResultSet. The precondition for this method is that the ResultSet is currently at the row to convert to an java.lang.Object from the correct table.

result the ResultSet containing the row to convert to an Object
modelClass the Class of the Object being instantiated
a populated instance of the specified Class
com.clarionmedia.infinitum.orm.exception.ModelConfigurationException if the specified model Class does not contain an empty constructor
com.clarionmedia.infinitum.exception.InfinitumRuntimeException if the model could not be instantiated
java.lang.IllegalArgumentException if the ModelFactory implementation cannot process the ResultSet type
	<T> T createFromResult(ResultSet resultClass<T> modelClass)
New to GrepCode? Check out our FAQ X