com.sri.emo.wizard.completion.persistence
Class ExpressoCompletionRepository

java.lang.Object
  extended by com.sri.emo.wizard.completion.persistence.ExpressoCompletionRepository
All Implemented Interfaces:
CompletionRepository

public class ExpressoCompletionRepository
extends Object
implements CompletionRepository

Expresso-specific implementation that converts the completion beans to DBObjects.

Author:
Michael Rimov

Constructor Summary
ExpressoCompletionRepository(CompletionDBObjConverter converter)
          Completion Repository constructor that takes a converter.
 
Method Summary
 int add(CompletionBean newValue)
          Adds a CompletionBean to the underlying data store.
 void delete(int wizardId)
          Deletes the completion bean from the underlying data store.
 CompletionBean findById(int wizardId)
          Finds the completion bean by id number.
 CompletionBean findById(Object previouslyGeneratedKey)
          Finds the bean by an id that was generated earlier by other pieces of the factory.
 void update(CompletionBean newValue)
          Updates the completion bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressoCompletionRepository

public ExpressoCompletionRepository(CompletionDBObjConverter converter)
Completion Repository constructor that takes a converter.

Parameters:
converter - CompletionDBObjConverter
Method Detail

add

public int add(CompletionBean newValue)
        throws RepositoryException,
               RepositoryConversionException
Adds a CompletionBean to the underlying data store.

Specified by:
add in interface CompletionRepository
Parameters:
newValue - CompletionBean the metadata for the wizard to update.
Returns:
the new wizard id.
Throws:
RepositoryException - upon underlying error.
RepositoryConversionException - if there was an error converting the CompletionBean object to the underlying WizDefinition DBObject.

delete

public void delete(int wizardId)
            throws RepositoryException,
                   ObjectNotFoundException
Deletes the completion bean from the underlying data store.

Specified by:
delete in interface CompletionRepository
Parameters:
wizardId - int the wizard surrogate key.
Throws:
RepositoryException - upon deletion error.
ObjectNotFoundException - if the given wizard Id doesn't exist.

findById

public CompletionBean findById(int wizardId)
                        throws RepositoryException,
                               ObjectNotFoundException,
                               RepositoryConversionException
Description copied from interface: CompletionRepository
Finds the completion bean by id number.

Specified by:
findById in interface CompletionRepository
Parameters:
wizardId - int the underlying wizard id (surrogate key)
Returns:
CompletionBean the resulting bean.
Throws:
RepositoryException - for database communication error.
ObjectNotFoundException - if the record does not exist.
RepositoryConversionException - if there is an error converting the underlying dbobjects to POJOs

findById

public CompletionBean findById(Object previouslyGeneratedKey)
                        throws RepositoryException,
                               ObjectNotFoundException,
                               RepositoryConversionException
Description copied from interface: CompletionRepository
Finds the bean by an id that was generated earlier by other pieces of the factory.

Specified by:
findById in interface CompletionRepository
Parameters:
previouslyGeneratedKey - Object -- typically some form of integer
Returns:
CompletionBean the resulting bean.
Throws:
RepositoryException - for database communication error.
ObjectNotFoundException - if the record does not exist.
RepositoryConversionException - if there is an error converting the underlying dbobjects to POJOs

update

public void update(CompletionBean newValue)
            throws RepositoryException,
                   ObjectNotFoundException
Updates the completion bean.

Specified by:
update in interface CompletionRepository
Parameters:
newValue - CompletionBean
Throws:
RepositoryException - upon update erorr.
ObjectNotFoundException - if the wizard id specified in newValue doesn't exist in the underlying database object store.


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.