daoexamples.movie
Class MovieDAOImplJTA
java.lang.Object
daoexamples.movie.MovieDAOImplJTA
- All Implemented Interfaces:
- MovieDAO
- class MovieDAOImplJTA
- extends java.lang.Object
- implements MovieDAO
This class is a Data Access Object.
This class is designed for use with the Java Transaction API.
This class assumes that the caller is using JTA to demarcate
transactions.
You can learn more about JTA at
http://java.sun.com/products/jta/
Instances of this class are not thread-safe.
- Author:
- Sean C. Sullivan
- See Also:
MovieDAOImpl
Field Summary |
private boolean |
bIsClosed
|
private java.sql.Connection |
conn
|
private static org.apache.commons.logging.Log |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final org.apache.commons.logging.Log log
conn
private java.sql.Connection conn
bIsClosed
private boolean bIsClosed
MovieDAOImplJTA
public MovieDAOImplJTA()
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-nullyear
- must be non-nulltitle
- 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-nullrating
- must be non-nullyear
- must be non-nulltitle
- 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.