X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=source%2Fmircoders%2Fstorage%2FDatabaseCommentToMedia.java;h=8d6f0a129c71afa5ce33d72f347bdc4eee3b2c83;hb=d06e23e638f2538f263af76bd32da6b140f20ac6;hp=9f8807c4a921d22ee72ced10876cd2b20acdad2e;hpb=e44404fac09c8da04b5ef7874160cb91f8fc98a9;p=mir.git diff --git a/source/mircoders/storage/DatabaseCommentToMedia.java b/source/mircoders/storage/DatabaseCommentToMedia.java index 9f8807c4..8d6f0a12 100755 --- a/source/mircoders/storage/DatabaseCommentToMedia.java +++ b/source/mircoders/storage/DatabaseCommentToMedia.java @@ -37,17 +37,9 @@ import java.util.ArrayList; import mir.entity.EntityList; import mir.log.LoggerWrapper; import mir.storage.Database; -import mir.storage.StorageObjectFailure; +import mir.storage.DatabaseFailure; import mircoders.entity.EntityUploadedMedia; -/** - * implements abstract DB connection to the comment_x_media SQL table - * - * @author RK, mir-coders group - * @version $Id: DatabaseCommentToMedia.java,v 1.3.2.10 2005/02/10 16:22:22 rhindes Exp $ - * - */ - public class DatabaseCommentToMedia extends Database { private static DatabaseCommentToMedia instance; @@ -68,7 +60,7 @@ public class DatabaseCommentToMedia extends Database { } public void addMedia(String commentId, String mediaId) throws - StorageObjectFailure { + DatabaseFailure { if (commentId == null && mediaId == null) { return; } @@ -87,7 +79,7 @@ public class DatabaseCommentToMedia extends Database { } catch (Exception e) { logger.error("-- add media failed -- insert"); - throw new StorageObjectFailure("-- add media failed -- insert ", e); + throw new DatabaseFailure("-- add media failed -- insert ", e); } finally { freeConnection(con, stmt); @@ -95,7 +87,7 @@ public class DatabaseCommentToMedia extends Database { } public void setMedia(String commentId, String mediaId) throws - StorageObjectFailure { + DatabaseFailure { if (commentId == null && mediaId == null) { return; } @@ -112,7 +104,7 @@ public class DatabaseCommentToMedia extends Database { } catch (Exception e) { logger.error("-- set media failed -- delete"); - throw new StorageObjectFailure("-- set media failed -- delete ", e); + throw new DatabaseFailure("-- set media failed -- delete ", e); } finally { freeConnection(con, stmt); @@ -131,14 +123,14 @@ public class DatabaseCommentToMedia extends Database { } catch (Exception e) { logger.error("-- set media failed -- insert"); - throw new StorageObjectFailure("-- set media failed -- insert ", e); + throw new DatabaseFailure("-- set media failed -- insert ", e); } finally { freeConnection(con, stmt); } } - public void deleteByCommentId(String commentId) throws StorageObjectFailure { + public void deleteByCommentId(String commentId) throws DatabaseFailure { if (commentId == null) { //theLog.printDebugInfo("-- delete topics failed -- no comment id"); return; @@ -156,7 +148,7 @@ public class DatabaseCommentToMedia extends Database { } catch (Exception e) { logger.error("-- delete by commentId failed "); - throw new StorageObjectFailure( + throw new DatabaseFailure( "-- delete by comment id failed -- delete ", e); } finally { @@ -164,7 +156,7 @@ public class DatabaseCommentToMedia extends Database { } } - public void deleteByMediaId(String mediaId) throws StorageObjectFailure { + public void deleteByMediaId(String mediaId) throws DatabaseFailure { if (mediaId == null) { //theLog.printDebugInfo("-- delete topics failed -- no topic id"); return; @@ -183,7 +175,7 @@ public class DatabaseCommentToMedia extends Database { } catch (Exception e) { logger.error("-- delete media failed "); - throw new StorageObjectFailure("-- delete by media id failed -- ", e); + throw new DatabaseFailure("-- delete by media id failed -- ", e); } finally { freeConnection(con, stmt); @@ -191,7 +183,7 @@ public class DatabaseCommentToMedia extends Database { } public void delete(String commentId, String mediaId) throws - StorageObjectFailure { + DatabaseFailure { if (mediaId == null || commentId == null) { logger.debug("-- delete media failed -- missing parameter"); return; @@ -211,7 +203,7 @@ public class DatabaseCommentToMedia extends Database { } catch (Exception e) { logger.error("-- delete comment_x_media failed "); - throw new StorageObjectFailure("-- delete comment_x_media failed -- ", e); + throw new DatabaseFailure("-- delete comment_x_media failed -- ", e); } finally { freeConnection(con, stmt); @@ -219,7 +211,7 @@ public class DatabaseCommentToMedia extends Database { } public EntityList getComment(EntityUploadedMedia media) throws - StorageObjectFailure { + DatabaseFailure { EntityList returnList = null; if (media != null) { @@ -236,7 +228,7 @@ public class DatabaseCommentToMedia extends Database { } catch (Exception e) { logger.error("-- get comment failed"); - throw new StorageObjectFailure("-- get comment failed -- ", e); + throw new DatabaseFailure("-- get comment failed -- ", e); } } return returnList; @@ -247,7 +239,7 @@ public class DatabaseCommentToMedia extends Database { * a relation to a media */ - public EntityList getComment() throws StorageObjectFailure { + public EntityList getComment() throws DatabaseFailure { EntityList returnList = null; ArrayList extraTables = new ArrayList(); @@ -261,7 +253,7 @@ public class DatabaseCommentToMedia extends Database { } catch (Exception e) { logger.error("-- get comment failed"); - throw new StorageObjectFailure("-- get comment failed -- ", e); + throw new DatabaseFailure("-- get comment failed -- ", e); } return returnList;