package ai.elimu.model.content;

import javax.persistence.Entity;
import ai.elimu.model.BaseEntity;
import ai.elimu.model.content.multimedia.Audio;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OrderColumn;
import javax.validation.constraints.NotNull;

@Entity
public class StoryBookParagraph extends BaseEntity {
    
    @ManyToOne
    private StoryBookChapter storyBookChapter;
    
    /**
     * [0, 1, 2, ...]
     */
    @NotNull
    private Integer sortOrder;
    
    @NotNull
    @Column(length = 1024)
    private String originalText;
    
    @OrderColumn
    @ManyToMany(fetch = FetchType.EAGER)
    private List<Word> words;
    
    @Deprecated
    @ManyToOne
    private Audio audio;
    
    public StoryBookChapter getStoryBookChapter() {
        return storyBookChapter;
    }

    public void setStoryBookChapter(StoryBookChapter storyBookChapter) {
        this.storyBookChapter = storyBookChapter;
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    public String getOriginalText() {
        return originalText;
    }

    public void setOriginalText(String originalText) {
        this.originalText = originalText;
    }

    public List<Word> getWords() {
        return words;
    }

    public void setWords(List<Word> words) {
        this.words = words;
    }
    
    public Audio getAudio() {
        return audio;
    }

    public void setAudio(Audio audio) {
        this.audio = audio;
    }
}

@@ -97,56 +97,8 @@
 ty;%0A
-import ai.elimu.model.content.multimedia.Audio;%0A
 impo
@@ -116,16 +116,16 @@
 l.List;%0A
+
 import j
@@ -732,74 +732,9 @@
 ds;%0A
-    %0A    @Deprecated%0A    @ManyToOne%0A    private Audio audio;%0A    
 %0A
+
     
@@ -1438,144 +1438,7 @@
   %7D%0A
-    %0A    public Audio getAudio() %7B%0A        return audio;%0A    %7D%0A%0A    public void setAudio(Audio audio) %7B%0A        this.audio = audio;%0A    %7D
 %0A%7D%0A

Update StoryBookParagraph.java