01: /**
02: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
03: *
04: * Permission is hereby granted, free of charge, to any person obtaining a copy
05: * of this software and associated documentation files (the "Software"), to deal
06: * in the Software without restriction, including without limitation the rights
07: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
08: * copies of the Software, and to permit persons to whom the Software is
09: * furnished to do so, subject to the following conditions:
10: *
11: * The above copyright notice and this permission notice shall be included in
12: * all copies or substantial portions of the Software.
13: *
14: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20: * SOFTWARE.
21: */package com.liferay.mail.service.persistence;
22:
23: import com.liferay.mail.NoSuchCyrusVirtualException;
24: import com.liferay.mail.model.CyrusVirtual;
25: import com.liferay.portal.SystemException;
26: import com.liferay.portal.kernel.bean.BeanLocatorUtil;
27:
28: import java.util.List;
29:
30: /**
31: * <a href="CyrusVirtualUtil.java.html"><b><i>View Source</i></b></a>
32: *
33: * @author Brian Wing Shun Chan
34: *
35: */
36: public class CyrusVirtualUtil {
37:
38: public static void remove(String emailAddress)
39: throws NoSuchCyrusVirtualException, SystemException {
40:
41: getPersistence().remove(emailAddress);
42: }
43:
44: public static void update(CyrusVirtual user) throws SystemException {
45: getPersistence().update(user);
46: }
47:
48: public static CyrusVirtual findByPrimaryKey(String emailAddress)
49: throws NoSuchCyrusVirtualException, SystemException {
50:
51: return getPersistence().findByPrimaryKey(emailAddress);
52: }
53:
54: public static List findByUserId(long userId) throws SystemException {
55: return getPersistence().findByUserId(userId);
56: }
57:
58: public static void removeByUserId(long userId)
59: throws SystemException {
60: getPersistence().removeByUserId(userId);
61: }
62:
63: public static CyrusVirtualPersistence getPersistence() {
64: return _getUtil()._persistence;
65: }
66:
67: public void setPersistence(CyrusVirtualPersistence persistence) {
68: _persistence = persistence;
69: }
70:
71: private static CyrusVirtualUtil _getUtil() {
72: if (_util == null) {
73: _util = (CyrusVirtualUtil) BeanLocatorUtil.locate(_UTIL);
74: }
75:
76: return _util;
77: }
78:
79: private static final String _UTIL = CyrusVirtualUtil.class
80: .getName();
81:
82: private static CyrusVirtualUtil _util;
83:
84: private CyrusVirtualPersistence _persistence;
85:
86: }
|