com.heckmansoft.surjey.model.datastore
Class SectionDatastore

java.lang.Object
  extended bycom.heckmansoft.surjey.model.datastore.Datastore
      extended bycom.heckmansoft.surjey.model.datastore.SectionDatastore
Direct Known Subclasses:
SectionManager

public class SectionDatastore
extends Datastore

Manages object-relational mapping for Section objects.


Constructor Summary
SectionDatastore()
          Constructor.
 
Method Summary
protected  Section createSection()
          Create a new section.
protected  ValueObject extract(java.sql.ResultSet results)
          Extract an object from the given result set.
 Section findById(java.lang.String id)
          Finds a particular survey.
 ValueObjectList findBySurveyId(java.lang.String id)
          Finds all sections for a given survey.
protected  java.util.List getArgs(ValueObject vo)
          From the given object, get a list of arguments to use for constructing a query or update.
 boolean removeBySurveyId(java.lang.String id)
          Removes all sections for a given survey.
 
Methods inherited from class com.heckmansoft.surjey.model.datastore.Datastore
executeDelete, executeInsert, executeUpdate, extract, extractList, extractSingle, findAll, generateDeleteSQL, generateInsertSQL, generateSelectSQL, generateUpdateSQL, getConnection, getTransaction, insert, insert, populateStatement, remove, remove, remove, selectAll, selectById, selectWhere, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SectionDatastore

public SectionDatastore()
Constructor.

Method Detail

findById

public Section findById(java.lang.String id)
                 throws DatastoreException
Finds a particular survey.

Parameters:
id - Id of the survey to find.
Returns:
A Survey instance, or null if no survey found
Throws:
DatastoreException

findBySurveyId

public ValueObjectList findBySurveyId(java.lang.String id)
                               throws DatastoreException
Finds all sections for a given survey.

Parameters:
id - Id of the survey containing the sections to find.
Returns:
A list of matching Section instances
Throws:
DatastoreException

removeBySurveyId

public boolean removeBySurveyId(java.lang.String id)
                         throws DatastoreException
Removes all sections for a given survey.

Parameters:
id - Id of survey for which sections are to be removed
Returns:
true if all matching sections are found and removed
Throws:
DatastoreException

getArgs

protected java.util.List getArgs(ValueObject vo)
From the given object, get a list of arguments to use for constructing a query or update.

Overrides:
getArgs in class Datastore
Parameters:
vo - Object containing data to use.
Returns:
A list of arguments.

extract

protected ValueObject extract(java.sql.ResultSet results)
                       throws DatastoreException
Extract an object from the given result set.

Overrides:
extract in class Datastore
Parameters:
results - The result set.
Returns:
The newly extracted object.
Throws:
DatastoreException

createSection

protected Section createSection()
Create a new section.

Returns:
newly created section.