// // Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // $Id: Thread.pdl 287 2005-02-22 00:29:02Z sskracic $ // $DateTime: 2004/08/16 18:10:38 $ model com.arsdigita.messaging; import com.arsdigita.kernel.ACSObject; import com.arsdigita.kernel.Party; object type Thread extends ACSObject { Date[1..1] lastUpdate = message_threads.last_update TIMESTAMP; BigDecimal[1..1] numReplies = message_threads.num_replies INTEGER; ThreadedMessage[1..1] root = join message_threads.root_id to messages.message_id; Party[1..1] author = join message_threads.sender to parties.party_id; reference key (message_threads.thread_id); aggressive load ( root.id, root.objectType, root.objectID, root.subject, author.id, author.objectType, author.displayName, author.defaultDomainClass ); } data operation incrNumReplies { do { update message_threads set num_replies = num_replies + 1 where thread_id = :threadID } } data operation decrNumReplies { do { update message_threads set num_replies = num_replies - 1 where thread_id = :threadID } }