package mircoders.storage;
+import mir.entity.EntityList;
+import mir.log.LoggerWrapper;
+import mir.storage.Database;
+import mir.storage.DatabaseFailure;
+import mircoders.entity.EntityContent;
+import mircoders.entity.EntityTopics;
+
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Iterator;
import java.util.List;
-import mir.entity.EntityList;
-import mir.log.LoggerWrapper;
-import mir.storage.Database;
-import mir.storage.StorageObjectFailure;
-import mircoders.entity.EntityContent;
-import mircoders.entity.EntityTopics;
-
/**
* <b>This class implements the 1-n-relation between
* content and topic
* Returns a List of String-Objects from a content-id.
*/
public List getTopicsOfContent(String contentId)
- throws StorageObjectFailure {
+ throws DatabaseFailure {
ArrayList returnList = new ArrayList();
if (contentId != null) {
return result;
}
- public void setTopics(String anArticleId, String [] aTopics) throws StorageObjectFailure {
+ public void setTopics(String anArticleId, String [] aTopics) throws DatabaseFailure {
if (aTopics==null)
setTopics(anArticleId, (List) null);
else
setTopics(anArticleId, Arrays.asList(aTopics));
}
- public void setTopics(String anArticleId, List aTopics) throws StorageObjectFailure {
+ public void setTopics(String anArticleId, List aTopics) throws DatabaseFailure {
List newTopics = new ArrayList();
if (aTopics!=null) {
Iterator i = aTopics.iterator();
}
public void deleteByContentId(String contentId)
- throws StorageObjectFailure {
+ throws DatabaseFailure {
if (contentId == null) {
//theLog.printDebugInfo("-- delete topics failed -- no content id");
return;
}
public void deleteByTopicId(String topicId)
- throws StorageObjectFailure {
+ throws DatabaseFailure {
if (topicId == null) {
//theLog.printDebugInfo("-- delete topics failed -- no topic id");
return;
* Returns list of Content for a specific topic
* @param topic
* @return EntityList
- * @throws StorageObjectFailure
+ * @throws DatabaseFailure
*/
public EntityList getContent(EntityTopics topic)
- throws StorageObjectFailure {
+ throws DatabaseFailure {
EntityList returnList=null;
if (topic != null) {
String id = topic.getId();