001/* 002 $Id: AnnotatableData.java 3207 2009-04-09 06:48:11Z gregory $ 003 004 Copyright (C) 2006 Gregory Vincic, Olle Mansson 005 Copyright (C) 2007 Gregory Vincic 006 007 This file is part of Proteios. 008 Available at http://www.proteios.org/ 009 010 Proteios is free software; you can redistribute it and/or modify it 011 under the terms of the GNU General Public License as published by 012 the Free Software Foundation; either version 2 of the License, or 013 (at your option) any later version. 014 015 Proteios is distributed in the hope that it will be useful, but 016 WITHOUT ANY WARRANTY; without even the implied warranty of 017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 018 General Public License for more details. 019 020 You should have received a copy of the GNU General Public License 021 along with this program; if not, write to the Free Software 022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 023 02111-1307, USA. 024*/ 025package org.proteios.core.data; 026 027/** 028 An annotatable item is an item that can be annotated with 029 name/value pairs. All annotations are held in an {@link 030 AnnotationSetData} object. 031 <p> 032 This interface defines Hibernate database mapping for the 033 <code>annotationSet</code> association to a column with 034 the name <code>annotationset_id</code>. If a subclass wants 035 to map the association to another column, it should override 036 the {@link #getAnnotationSet()} method and add a Hibernate tag 037 in the comment. 038 <p> 039 040 <b>Reference implementation</b><br> 041 <pre class="code"> 042private AnnotationSetData annotationSet; 043public AnnotationSetData getAnnotationSet() 044{ 045 return annotationSet; 046} 047public void setAnnotationSet(AnnotationSetData annotationSet) 048{ 049 this.annotationSet = annotationSet; 050} 051</pre> 052 053 @author Nicklas 054 @version 2.0 055 @see AnnotatedData 056 @see AnnotationSetData 057 @see AnnotationData 058 @see AnnotationTypeData 059 @see org.proteios.core.Annotatable 060 @see <a href="../../../../../../../development/overview/data/annotations.html">Annotations overview</a> 061*/ 062public interface AnnotatableData 063 extends IdentifiableData 064{ 065 /** 066 Get the annotation set that holds the annotations for an item. 067 @return An <code>AnnotationSetData</code> item or null if no annotations exist 068 @hibernate.many-to-one column="`annotationset_id`" not-null="false" unique="true" 069 outer-join="false" cascade="delete" 070 */ 071 public AnnotationSetData getAnnotationSet(); 072 073 /** 074 Change the annotation set. Use null to remove the annotations. 075 */ 076 public void setAnnotationSet(AnnotationSetData annotationSet); 077}