import mir.entity.EntityList;
import mir.log.LoggerWrapper;
import mir.storage.Database;
-import mir.storage.StorageObjectFailure;
+import mir.storage.DatabaseFailure;
import mircoders.entity.EntityUploadedMedia;
-/**
- * <b>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;
}
public void addMedia(String commentId, String mediaId) throws
- StorageObjectFailure {
+ DatabaseFailure {
if (commentId == null && mediaId == null) {
return;
}
}
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);
}
public void setMedia(String commentId, String mediaId) throws
- StorageObjectFailure {
+ DatabaseFailure {
if (commentId == null && mediaId == null) {
return;
}
}
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);
}
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;
}
catch (Exception e) {
logger.error("-- delete by commentId failed ");
- throw new StorageObjectFailure(
+ throw new DatabaseFailure(
"-- delete by comment id failed -- delete ", e);
}
finally {
}
}
- 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;
}
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);
}
public void delete(String commentId, String mediaId) throws
- StorageObjectFailure {
+ DatabaseFailure {
if (mediaId == null || commentId == null) {
logger.debug("-- delete media failed -- missing parameter");
return;
}
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);
}
public EntityList getComment(EntityUploadedMedia media) throws
- StorageObjectFailure {
+ DatabaseFailure {
EntityList returnList = null;
if (media != null) {
}
catch (Exception e) {
logger.error("-- get comment failed");
- throw new StorageObjectFailure("-- get comment failed -- ", e);
+ throw new DatabaseFailure("-- get comment failed -- ", e);
}
}
return returnList;
* a relation to a media
*/
- public EntityList getComment() throws StorageObjectFailure {
+ public EntityList getComment() throws DatabaseFailure {
EntityList returnList = null;
ArrayList extraTables = new ArrayList();
}
catch (Exception e) {
logger.error("-- get comment failed");
- throw new StorageObjectFailure("-- get comment failed -- ", e);
+ throw new DatabaseFailure("-- get comment failed -- ", e);
}
return returnList;