Package backend.linguisticFeatures
Class TopicDAO
java.lang.Object
backend.linguisticFeatures.TopicDAO
- Author:
- Kai
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidfindByTopic(String topic) Finds a document by documentId and returns it as a JSON string.List<org.bson.Document>Returns all topics from the collection.Returns a list of speeches by topic.getSpeechesByTopics(List<String> topics) getSpeechIdsByTopics(List<String> topics) Findet alle Reden-IDs für mehrere Topics.voidSaves a JSON string to MongoDB.voidUpdates a document using a JSON string.
-
Constructor Details
-
TopicDAO
- Throws:
IOException
-
-
Method Details
-
getAllTopics
Returns all topics from the collection.- Returns:
- List
mit allen Topics
-
getSpeechesByTopic
Returns a list of speeches by topic.- Parameters:
id- id des topics.- Throws:
IOException
-
getSpeechIdsByTopics
Findet alle Reden-IDs für mehrere Topics.- Parameters:
topics- Liste der Topic-IDs- Returns:
- Set von Speech-IDs, die zu mindestens einem der Topics gehören
-
getSpeechesByTopics
- Parameters:
topics- Liste der Topic-IDs- Returns:
- Liste von Speech_impl-Objekten
- Throws:
IOException- wenn ein Datenbankfehler auftritt
-
save
Saves a JSON string to MongoDB. -
findByTopic
Finds a document by documentId and returns it as a JSON string. -
update
Updates a document using a JSON string. -
delete
-
close
public void close()
-