/* Copyright 2006 - 2010 Under Dusken Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package no.dusken.aranea.model; import javax.persistence.*; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; /** * @author Marvin B. Lillehaug <lillehau@underdusken.no> */ @Entity @Table(name = "quote") @SequenceGenerator(name = "quote_seq", sequenceName = "quote_id_seq") public class Quote extends AraneaObject { @Column @Size(max = 255, min = 2) @NotNull private String source; @Column(length = 1000) @Size(max = 1000, min = 5) @NotNull private String text; @ManyToOne private Article article; @Column @Min(0) private Integer paragraph; public Article getArticle() { return article; } public void setArticle(Article article) { this.article = article; } public String getSource() { return source; } public void setSource(String source) { this.source = source; } public String getText() { return text; } public void setText(String text) { this.text = text; } public String toString() { return "Quote: " + text; } public Integer getParagraph() { return paragraph; } public void setParagraph(Integer paragraph) { this.paragraph = paragraph; } }