Class TopicDAO

java.lang.Object
backend.linguisticFeatures.TopicDAO

public class TopicDAO extends Object
Author:
Kai
  • Constructor Details

  • Method Details

    • getAllTopics

      public List<org.bson.Document> getAllTopics()
      Returns all topics from the collection.
      Returns:
      List mit allen Topics
    • getSpeechesByTopic

      public List<Speech_impl> getSpeechesByTopic(String id) throws IOException
      Returns a list of speeches by topic.
      Parameters:
      id - id des topics.
      Throws:
      IOException
    • getSpeechIdsByTopics

      public Set<String> getSpeechIdsByTopics(List<String> topics)
      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

      public List<Speech_impl> getSpeechesByTopics(List<String> topics) throws IOException
      Parameters:
      topics - Liste der Topic-IDs
      Returns:
      Liste von Speech_impl-Objekten
      Throws:
      IOException - wenn ein Datenbankfehler auftritt
    • save

      public void save(String jsonData)
      Saves a JSON string to MongoDB.
    • findByTopic

      public String findByTopic(String topic)
      Finds a document by documentId and returns it as a JSON string.
    • update

      public void update(String jsonData)
      Updates a document using a JSON string.
    • delete

      public void delete(String topic)
    • close

      public void close()