001: /*
002: * Copyright (c) 2001 - 2005 ivata limited.
003: * All rights reserved.
004: * -----------------------------------------------------------------------------
005: * ivata groupware may be redistributed under the GNU General Public
006: * License as published by the Free Software Foundation;
007: * version 2 of the License.
008: *
009: * These programs are free software; you can redistribute them and/or
010: * modify them under the terms of the GNU General Public License
011: * as published by the Free Software Foundation; version 2 of the License.
012: *
013: * These programs are distributed in the hope that they will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: *
017: * See the GNU General Public License in the file LICENSE.txt for more
018: * details.
019: *
020: * If you would like a copy of the GNU General Public License write to
021: *
022: * Free Software Foundation, Inc.
023: * 59 Temple Place - Suite 330
024: * Boston, MA 02111-1307, USA.
025: *
026: *
027: * To arrange commercial support and licensing, contact ivata at
028: * http://www.ivata.com/contact.jsp
029: * -----------------------------------------------------------------------------
030: * $Log: QueryPersistenceManager.java,v $
031: * Revision 1.2 2005/04/09 17:19:37 colinmacleod
032: * Changed copyright text to GPL v2 explicitly.
033: *
034: * Revision 1.1 2005/03/10 19:23:04 colinmacleod
035: * Moved to ivata groupware.
036: *
037: * Revision 1.1 2004/11/12 16:08:12 colinmacleod
038: * Removed dependencies on SSLEXT.
039: * Moved Persistence classes to ivata masks.
040: *
041: * Revision 1.2 2004/08/01 11:55:03 colinmacleod
042: * Added removeAll.
043: *
044: * Revision 1.1 2004/07/13 19:42:44 colinmacleod
045: * Moved project to POJOs from EJBs.
046: * Applied PicoContainer to services layer (replacing session EJBs).
047: * Applied Hibernate to persistence layer (replacing entity EJBs).
048: * -----------------------------------------------------------------------------
049: */
050: package com.ivata.groupware.container.persistence;
051:
052: import java.util.List;
053:
054: import com.ivata.groupware.container.persistence.listener.AddPersistenceListener;
055: import com.ivata.groupware.container.persistence.listener.AmendPersistenceListener;
056: import com.ivata.groupware.container.persistence.listener.RemovePersistenceListener;
057: import com.ivata.mask.persistence.PersistenceException;
058: import com.ivata.mask.persistence.PersistenceManager;
059: import com.ivata.mask.persistence.PersistenceSession;
060: import com.ivata.mask.valueobject.ValueObject;
061:
062: /**
063: * Extends the <strong>ivata masks</strong> persistence manager to include
064: * facilities to execute queries against the persistence store, and adds
065: * listeners.
066: *
067: * @author Colin MacLeod
068: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
069: * @since Mar 27, 2004
070: * @version $Revision: 1.2 $
071: */
072: public interface QueryPersistenceManager extends PersistenceManager {
073: void addAddListener(Class dOClass, AddPersistenceListener listener);
074:
075: void addAmendListener(Class dOClass,
076: AmendPersistenceListener listener);
077:
078: void addRemoveListener(Class dOClass,
079: RemovePersistenceListener listener);
080:
081: List find(final PersistenceSession session, final String queryName,
082: final Object[] queryArguments) throws PersistenceException;
083:
084: List find(final PersistenceSession session, final String queryName,
085: final Object[] queryArguments, final Integer pageSize,
086: final Integer pageNumber) throws PersistenceException;
087:
088: ValueObject findInstance(final PersistenceSession session,
089: final String queryName, final Object[] queryArguments)
090: throws PersistenceException;
091:
092: Integer findInteger(final PersistenceSession session,
093: final String queryName, final Object[] queryArguments)
094: throws PersistenceException;
095:
096: String findString(final PersistenceSession session,
097: final String queryName, final Object[] queryArguments)
098: throws PersistenceException;
099:
100: void remove(final PersistenceSession session,
101: final ValueObject valueObject) throws PersistenceException;
102:
103: void removeAll(final PersistenceSession session,
104: final String queryName, final Object[] queryArguments)
105: throws PersistenceException;
106: }
|