001/*
002        $Id: RemovableData.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        A removable item is an item that can be flagged
029        as removed. This doesn't remove the information about the
030        item from the database, but can be used by client applications
031        to hide items that the user is not interested in.
032        <p>
033        For example, all methods generating lists of items, will by default
034        not include items that are flagged as removed.
035        <p>
036        A cleaning application is usually run at regular intervals
037        to remove items that have been flagged as removed.
038        
039        <p>
040        This interface defines Hibernate database mapping for the
041        <code>removed</code> property to a database column with the same 
042        name. If a subclass wants to map these properties to other columns, 
043        it should override the {@link #isRemoved()} method and add a 
044        Hibernate tag in the comment.
045        <p>
046        
047        <b>Reference implementation</b><br>
048        <pre class="code">
049private boolean removed;
050public boolean isRemoved()
051{
052   return removed;
053}
054public void setRemoved(boolean removed)
055{
056   this.removed = removed;
057}
058</pre>
059
060        @author Nicklas
061        @version 2.0
062        @see <a href="../../../../../../../development/overview/data/basic.html">Basic classes and interfaces</a>
063*/
064public interface RemovableData
065        extends IdentifiableData
066{
067
068        /**
069                Check if the removed flag is set for this item.
070                @return TRUE if the item is flagged as removed, FALSE otherwise
071                @hibernate.property column="`removed`" type="boolean" not-null="true"
072        */
073        public boolean isRemoved();
074
075        /**
076                Set the removed flag for this item.
077                @param removed TRUE if the item should be flagged as removed,
078                        FALSE otherwise
079        */
080        public void setRemoved(boolean removed);
081
082}