KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > container > persistence > QueryPersistenceManager


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: QueryPersistenceManager.java,v $
31  * Revision 1.2 2005/04/09 17:19:37 colinmacleod
32  * Changed copyright text to GPL v2 explicitly.
33  *
34  * Revision 1.1 2005/03/10 19:23:04 colinmacleod
35  * Moved to ivata groupware.
36  *
37  * Revision 1.1 2004/11/12 16:08:12 colinmacleod
38  * Removed dependencies on SSLEXT.
39  * Moved Persistence classes to ivata masks.
40  *
41  * Revision 1.2 2004/08/01 11:55:03 colinmacleod
42  * Added removeAll.
43  *
44  * Revision 1.1 2004/07/13 19:42:44 colinmacleod
45  * Moved project to POJOs from EJBs.
46  * Applied PicoContainer to services layer (replacing session EJBs).
47  * Applied Hibernate to persistence layer (replacing entity EJBs).
48  * -----------------------------------------------------------------------------
49  */

50 package com.ivata.groupware.container.persistence;
51
52 import java.util.List JavaDoc;
53
54 import com.ivata.groupware.container.persistence.listener.AddPersistenceListener;
55 import com.ivata.groupware.container.persistence.listener.AmendPersistenceListener;
56 import com.ivata.groupware.container.persistence.listener.RemovePersistenceListener;
57 import com.ivata.mask.persistence.PersistenceException;
58 import com.ivata.mask.persistence.PersistenceManager;
59 import com.ivata.mask.persistence.PersistenceSession;
60 import com.ivata.mask.valueobject.ValueObject;
61
62 /**
63  * Extends the <strong>ivata masks</strong> persistence manager to include
64  * facilities to execute queries against the persistence store, and adds
65  * listeners.
66  *
67  * @author Colin MacLeod
68  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
69  * @since Mar 27, 2004
70  * @version $Revision: 1.2 $
71  */

72 public interface QueryPersistenceManager extends PersistenceManager {
73     void addAddListener(Class JavaDoc dOClass, AddPersistenceListener listener);
74     void addAmendListener(Class JavaDoc dOClass, AmendPersistenceListener listener);
75     void addRemoveListener(Class JavaDoc dOClass, RemovePersistenceListener listener);
76     List JavaDoc find(final PersistenceSession session,
77             final String JavaDoc queryName,
78             final Object JavaDoc [] queryArguments) throws PersistenceException;
79     List JavaDoc find(final PersistenceSession session,
80             final String JavaDoc queryName,
81             final Object JavaDoc [] queryArguments,
82             final Integer JavaDoc pageSize,
83             final Integer JavaDoc pageNumber) throws PersistenceException;
84     ValueObject findInstance(final PersistenceSession session,
85             final String JavaDoc queryName,
86             final Object JavaDoc [] queryArguments) throws PersistenceException;
87     Integer JavaDoc findInteger(final PersistenceSession session,
88             final String JavaDoc queryName,
89             final Object JavaDoc [] queryArguments) throws PersistenceException;
90     String JavaDoc findString(final PersistenceSession session,
91             final String JavaDoc queryName,
92             final Object JavaDoc [] queryArguments) throws PersistenceException;
93     void remove(final PersistenceSession session,
94             final ValueObject valueObject) throws PersistenceException;
95     void removeAll(final PersistenceSession session,
96             final String JavaDoc queryName,
97             final Object JavaDoc [] queryArguments) throws PersistenceException;
98 }
99
Popular Tags