package com.avaje.tests.model.basic; import com.avaje.ebean.annotation.CacheStrategy; import com.avaje.ebean.annotation.CacheTuning; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.OneToMany; import java.util.ArrayList; import java.util.List; @CacheStrategy @CacheTuning(maxSecsToLive = 45) @Entity public class Article extends BasicDomain { String name; String author; @OneToMany(cascade = CascadeType.ALL) List
sections; public Article() { } public Article(String name, String author) { this.name = name; this.author = author; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public List
getSections() { return sections; } public void setSections(List
sections) { this.sections = sections; } public void addSection(Section s) { if (sections == null) { sections = new ArrayList
(); } sections.add(s); } }