projects
/
mir.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixing scaling images -> nullpointer, patch by yossarian
[mir.git]
/
source
/
mircoders
/
storage
/
DatabaseCommentToMedia.java
diff --git
a/source/mircoders/storage/DatabaseCommentToMedia.java
b/source/mircoders/storage/DatabaseCommentToMedia.java
index
9f8807c
..
8d6f0a1
100755
(executable)
--- 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.entity.EntityList;
import mir.log.LoggerWrapper;
import mir.storage.Database;
-import mir.storage.
StorageObject
Failure;
+import mir.storage.
Database
Failure;
import mircoders.entity.EntityUploadedMedia;
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 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
}
public void addMedia(String commentId, String mediaId) throws
-
StorageObject
Failure {
+
Database
Failure {
if (commentId == null && mediaId == null) {
return;
}
if (commentId == null && mediaId == null) {
return;
}
@@
-87,7
+79,7
@@
public class DatabaseCommentToMedia extends Database {
}
catch (Exception e) {
logger.error("-- add media failed -- insert");
}
catch (Exception e) {
logger.error("-- add media failed -- insert");
- throw new
StorageObject
Failure("-- add media failed -- insert ", e);
+ throw new
Database
Failure("-- add media failed -- insert ", e);
}
finally {
freeConnection(con, stmt);
}
finally {
freeConnection(con, stmt);
@@
-95,7
+87,7
@@
public class DatabaseCommentToMedia extends Database {
}
public void setMedia(String commentId, String mediaId) throws
}
public void setMedia(String commentId, String mediaId) throws
-
StorageObject
Failure {
+
Database
Failure {
if (commentId == null && mediaId == null) {
return;
}
if (commentId == null && mediaId == null) {
return;
}
@@
-112,7
+104,7
@@
public class DatabaseCommentToMedia extends Database {
}
catch (Exception e) {
logger.error("-- set media failed -- delete");
}
catch (Exception e) {
logger.error("-- set media failed -- delete");
- throw new
StorageObject
Failure("-- set media failed -- delete ", e);
+ throw new
Database
Failure("-- set media failed -- delete ", e);
}
finally {
freeConnection(con, stmt);
}
finally {
freeConnection(con, stmt);
@@
-131,14
+123,14
@@
public class DatabaseCommentToMedia extends Database {
}
catch (Exception e) {
logger.error("-- set media failed -- insert");
}
catch (Exception e) {
logger.error("-- set media failed -- insert");
- throw new
StorageObject
Failure("-- set media failed -- insert ", e);
+ throw new
Database
Failure("-- set media failed -- insert ", e);
}
finally {
freeConnection(con, stmt);
}
}
}
finally {
freeConnection(con, stmt);
}
}
- public void deleteByCommentId(String commentId) throws
StorageObject
Failure {
+ public void deleteByCommentId(String commentId) throws
Database
Failure {
if (commentId == null) {
//theLog.printDebugInfo("-- delete topics failed -- no comment id");
return;
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 ");
}
catch (Exception e) {
logger.error("-- delete by commentId failed ");
- throw new
StorageObject
Failure(
+ throw new
Database
Failure(
"-- delete by comment id failed -- delete ", e);
}
finally {
"-- delete by comment id failed -- delete ", e);
}
finally {
@@
-164,7
+156,7
@@
public class DatabaseCommentToMedia extends Database {
}
}
}
}
- public void deleteByMediaId(String mediaId) throws
StorageObject
Failure {
+ public void deleteByMediaId(String mediaId) throws
Database
Failure {
if (mediaId == null) {
//theLog.printDebugInfo("-- delete topics failed -- no topic id");
return;
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 ");
}
catch (Exception e) {
logger.error("-- delete media failed ");
- throw new
StorageObject
Failure("-- delete by media id failed -- ", e);
+ throw new
Database
Failure("-- delete by media id failed -- ", e);
}
finally {
freeConnection(con, stmt);
}
finally {
freeConnection(con, stmt);
@@
-191,7
+183,7
@@
public class DatabaseCommentToMedia extends Database {
}
public void delete(String commentId, String mediaId) throws
}
public void delete(String commentId, String mediaId) throws
-
StorageObject
Failure {
+
Database
Failure {
if (mediaId == null || commentId == null) {
logger.debug("-- delete media failed -- missing parameter");
return;
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 ");
}
catch (Exception e) {
logger.error("-- delete comment_x_media failed ");
- throw new
StorageObject
Failure("-- delete comment_x_media failed -- ", e);
+ throw new
Database
Failure("-- delete comment_x_media failed -- ", e);
}
finally {
freeConnection(con, stmt);
}
finally {
freeConnection(con, stmt);
@@
-219,7
+211,7
@@
public class DatabaseCommentToMedia extends Database {
}
public EntityList getComment(EntityUploadedMedia media) throws
}
public EntityList getComment(EntityUploadedMedia media) throws
-
StorageObject
Failure {
+
Database
Failure {
EntityList returnList = null;
if (media != null) {
EntityList returnList = null;
if (media != null) {
@@
-236,7
+228,7
@@
public class DatabaseCommentToMedia extends Database {
}
catch (Exception e) {
logger.error("-- get comment failed");
}
catch (Exception e) {
logger.error("-- get comment failed");
- throw new
StorageObject
Failure("-- get comment failed -- ", e);
+ throw new
Database
Failure("-- get comment failed -- ", e);
}
}
return returnList;
}
}
return returnList;
@@
-247,7
+239,7
@@
public class DatabaseCommentToMedia extends Database {
* a relation to a media
*/
* a relation to a media
*/
- public EntityList getComment() throws
StorageObject
Failure {
+ public EntityList getComment() throws
Database
Failure {
EntityList returnList = null;
ArrayList extraTables = new ArrayList();
EntityList returnList = null;
ArrayList extraTables = new ArrayList();
@@
-261,7
+253,7
@@
public class DatabaseCommentToMedia extends Database {
}
catch (Exception e) {
logger.error("-- get comment failed");
}
catch (Exception e) {
logger.error("-- get comment failed");
- throw new
StorageObject
Failure("-- get comment failed -- ", e);
+ throw new
Database
Failure("-- get comment failed -- ", e);
}
return returnList;
}
return returnList;