com.sptci.echo2demo
Class InputFormModelFactory

java.lang.Object
  extended by com.sptci.echo2demo.InputFormModelFactory
All Implemented Interfaces:
java.io.Serializable

public class InputFormModelFactory
extends java.lang.Object
implements java.io.Serializable

A factory class for abstracting interactions between the InputFormModel JDO JavaBean and the JDO data store.

Version:
$Id: InputFormModelFactory.java,v 1.2 2006/02/15 16:15:17 rakesh Exp $
Author:
com.sptci.echo2.JDOBeanGenerator 2006-02-09 10:00:16-0600
See Also:
Serialized Form

Field Summary
private static java.util.logging.Logger logger
          The logger used to log errors/warnings to.
private static InputFormModelFactory singleton
          The singleton instance of the class.
 
Constructor Summary
protected InputFormModelFactory()
          Default constructor.
 
Method Summary
 void delete(InputFormModel inputFormData)
          Delete the specified instance of InputFormModel from the JDO data store.
 java.util.Collection<InputFormModel> fetchAll()
          Return all the instance of InputFormModel from the JDO data store.
 InputFormModel fetchByIndex(int index)
          Return the object that occupies the specified index number in a list that contains all the object instances.
static InputFormModelFactory getInstance()
          Return the singleton instance of the class.
 int lastIndex()
          Return the list index number of the last record in a list that contains all the objects from the data store.
 void save(InputFormModel inputFormData)
          Save the specified instance of InputFormModel to the JDO data store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

private static final InputFormModelFactory singleton
The singleton instance of the class.


logger

private static final java.util.logging.Logger logger
The logger used to log errors/warnings to.

Constructor Detail

InputFormModelFactory

protected InputFormModelFactory()
Default constructor. Cannot be instantiated.

Method Detail

getInstance

public static final InputFormModelFactory getInstance()
Return the singleton instance of the class.

Returns:
InputFormModelFactory The singleton instance.

save

public void save(InputFormModel inputFormData)
Save the specified instance of InputFormModel to the JDO data store.

Parameters:
inputFormData - The instance to persist to the data store.

delete

public void delete(InputFormModel inputFormData)
Delete the specified instance of InputFormModel from the JDO data store.

Parameters:
inputFormData - The instance to delete from the data store.

fetchAll

public final java.util.Collection<InputFormModel> fetchAll()
Return all the instance of InputFormModel from the JDO data store.

Returns:
Collection An ArrayList of all the instances.

lastIndex

public final int lastIndex()
                    throws java.lang.RuntimeException
Return the list index number of the last record in a list that contains all the objects from the data store.

Returns:
int The list index number for the last record.
Throws:
java.lang.RuntimeException - If JDO exceptions are encountered while fetching the objects.

fetchByIndex

public InputFormModel fetchByIndex(int index)
                            throws java.lang.RuntimeException
Return the object that occupies the specified index number in a list that contains all the object instances.

Parameters:
index - The index at which the object exists.
Returns:
InputFormModel The appropriate object. Returns null if no object is found.
Throws:
java.lang.RuntimeException - If JDO exceptions are encountered while fetching the object.


Copyright © 2006 Sans Pareil Technologies, Inc. All Rights Reserved.