sk.stuba.fiit.foo07.genex.dao
Class PictureDaoDerby

java.lang.Object
  extended by sk.stuba.fiit.foo07.genex.dao.BasicDao
      extended by sk.stuba.fiit.foo07.genex.dao.PictureDaoDerby
All Implemented Interfaces:
PictureDao

public class PictureDaoDerby
extends BasicDao
implements PictureDao

Author:
Radu

Field Summary
protected  java.util.ArrayList<Picture> p_list
           
protected  Picture pic
           
protected  java.sql.PreparedStatement pstmt
           
protected  java.sql.ResultSet rs
           
protected  javax.sql.rowset.serial.SerialBlob sblob
           
 
Fields inherited from class sk.stuba.fiit.foo07.genex.dao.BasicDao
con
 
Constructor Summary
PictureDaoDerby(java.sql.Connection con)
           
 
Method Summary
 void addPicture(Picture toAdd)
           
 void addPictures(java.util.ArrayList<Picture> toAdd)
           
 void addPictureToQuestion(java.lang.Integer pictureId, java.lang.Integer questionId)
           
 void deletePicture(Picture toDelete)
           
 void deletePictureFromQuestion(java.lang.Integer pictureId, java.lang.Integer questionId)
           
 void deletePictures(java.util.ArrayList<Picture> toDelete)
           
 boolean existsPictureByName(java.lang.String name)
           
 java.util.ArrayList<Picture> getAllPictures()
           
 Picture getPictureByID(java.lang.Integer pictureID)
           
 java.util.ArrayList<Picture> getPicturesByQuestionID(java.lang.Integer QuestionID)
           
 java.util.ArrayList<Picture> getPicturesByTestID(java.lang.Integer testID)
           
 void updatePicture(Picture toUpdate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sblob

protected javax.sql.rowset.serial.SerialBlob sblob

pic

protected Picture pic

rs

protected java.sql.ResultSet rs

pstmt

protected java.sql.PreparedStatement pstmt

p_list

protected java.util.ArrayList<Picture> p_list
Constructor Detail

PictureDaoDerby

public PictureDaoDerby(java.sql.Connection con)
Parameters:
con -
Method Detail

addPicture

public void addPicture(Picture toAdd)
                throws java.sql.SQLException
Specified by:
addPicture in interface PictureDao
Throws:
java.sql.SQLException

addPictures

public void addPictures(java.util.ArrayList<Picture> toAdd)
                 throws java.sql.SQLException
Specified by:
addPictures in interface PictureDao
Throws:
java.sql.SQLException

deletePicture

public void deletePicture(Picture toDelete)
                   throws PictureInPictureQuestionException,
                          java.sql.SQLException
Specified by:
deletePicture in interface PictureDao
Throws:
PictureInPictureQuestionException
java.sql.SQLException

deletePictures

public void deletePictures(java.util.ArrayList<Picture> toDelete)
                    throws PictureInPictureQuestionException,
                           java.sql.SQLException
Specified by:
deletePictures in interface PictureDao
Throws:
PictureInPictureQuestionException
java.sql.SQLException

getPictureByID

public Picture getPictureByID(java.lang.Integer pictureID)
                       throws java.sql.SQLException
Specified by:
getPictureByID in interface PictureDao
Throws:
java.sql.SQLException

existsPictureByName

public boolean existsPictureByName(java.lang.String name)
                            throws java.sql.SQLException
Specified by:
existsPictureByName in interface PictureDao
Throws:
java.sql.SQLException

getPicturesByTestID

public java.util.ArrayList<Picture> getPicturesByTestID(java.lang.Integer testID)
                                                 throws java.sql.SQLException
Specified by:
getPicturesByTestID in interface PictureDao
Throws:
java.sql.SQLException

getAllPictures

public java.util.ArrayList<Picture> getAllPictures()
                                            throws java.sql.SQLException
Specified by:
getAllPictures in interface PictureDao
Throws:
java.sql.SQLException

getPicturesByQuestionID

public java.util.ArrayList<Picture> getPicturesByQuestionID(java.lang.Integer QuestionID)
                                                     throws java.sql.SQLException
Specified by:
getPicturesByQuestionID in interface PictureDao
Throws:
java.sql.SQLException

addPictureToQuestion

public void addPictureToQuestion(java.lang.Integer pictureId,
                                 java.lang.Integer questionId)
                          throws java.sql.SQLException
Specified by:
addPictureToQuestion in interface PictureDao
Throws:
java.sql.SQLException

deletePictureFromQuestion

public void deletePictureFromQuestion(java.lang.Integer pictureId,
                                      java.lang.Integer questionId)
                               throws java.sql.SQLException
Specified by:
deletePictureFromQuestion in interface PictureDao
Throws:
java.sql.SQLException

updatePicture

public void updatePicture(Picture toUpdate)
                   throws java.sql.SQLException
Specified by:
updatePicture in interface PictureDao
Throws:
java.sql.SQLException


Copyright © 2008 Faculty of Informatics and Information Technologies, STU Bratislava. All Rights Reserved.