daoexamples.movie
Class MovieDAOImpl

java.lang.Object
  extended bydaoexamples.movie.MovieDAOImpl
All Implemented Interfaces:
MovieDAO

class MovieDAOImpl
extends java.lang.Object
implements MovieDAO

This Data Access Object demarcates transactions internally. The caller cannot demarcate transactions. Transactions are demarcated using the JDBC API.

Instances of this class are not thread-safe.

Author:
Sean C. Sullivan
See Also:
MovieDAOImplJTA

Field Summary
private  boolean bIsClosed
           
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
MovieDAOImpl()
           
 
Method Summary
 void close()
           
 Movie createMovie(java.lang.String rating, java.lang.String year, java.lang.String title)
           
 void deleteMovie(java.lang.String id)
           
 Movie findMovieById(java.lang.String id)
           
 java.util.Collection findMoviesByYear(java.lang.String year)
           
 boolean isClosed()
           
 void updateMovie(java.lang.String id, java.lang.String rating, java.lang.String year, java.lang.String title)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

bIsClosed

private boolean bIsClosed
Constructor Detail

MovieDAOImpl

public MovieDAOImpl()
Method Detail

findMovieById

public Movie findMovieById(java.lang.String id)
                    throws MovieNotFoundException
Specified by:
findMovieById in interface MovieDAO
Parameters:
id - must be non-null
Returns:
a non-null object
Throws:
MovieNotFoundException
See Also:
MovieDAO.findMoviesByYear(String)

findMoviesByYear

public java.util.Collection findMoviesByYear(java.lang.String year)
Specified by:
findMoviesByYear in interface MovieDAO
Parameters:
year - must be non-null
Returns:
a Collection that contains zero or more Movie objects
See Also:
MovieDAO.findMovieById(String)

deleteMovie

public void deleteMovie(java.lang.String id)
                 throws MovieNotFoundException
Specified by:
deleteMovie in interface MovieDAO
Parameters:
id - must be non-null
Throws:
MovieNotFoundException
See Also:
MovieDAO.createMovie(String, String, String)

createMovie

public Movie createMovie(java.lang.String rating,
                         java.lang.String year,
                         java.lang.String title)
Specified by:
createMovie in interface MovieDAO
Parameters:
rating - must be non-null
year - must be non-null
title - must be non-null
Returns:
a non-null Movie object
See Also:
MovieDAO.deleteMovie(String)

updateMovie

public void updateMovie(java.lang.String id,
                        java.lang.String rating,
                        java.lang.String year,
                        java.lang.String title)
                 throws MovieNotFoundException
Specified by:
updateMovie in interface MovieDAO
Parameters:
id - must be non-null
rating - must be non-null
year - must be non-null
title - must be non-null
Throws:
MovieNotFoundException

close

public void close()
Specified by:
close in interface MovieDAO
See Also:
MovieDAO.isClosed()

isClosed

public boolean isClosed()
Specified by:
isClosed in interface MovieDAO
See Also:
MovieDAO.close()


Copyright © 2003-2004 daoexamples.sourceforge.net. All Rights Reserved.