001
014
015 package com.liferay.mail.service.persistence;
016
017 import com.liferay.mail.NoSuchCyrusVirtualException;
018 import com.liferay.mail.model.CyrusVirtual;
019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020 import com.liferay.portal.kernel.exception.SystemException;
021
022 import java.util.List;
023
024
027 public class CyrusVirtualUtil {
028
029 public static CyrusVirtual findByPrimaryKey(String emailAddress)
030 throws NoSuchCyrusVirtualException, SystemException {
031
032 return getPersistence().findByPrimaryKey(emailAddress);
033 }
034
035 public static List<CyrusVirtual> findByUserId(long userId)
036 throws SystemException {
037
038 return getPersistence().findByUserId(userId);
039 }
040
041 public static CyrusVirtualPersistence getPersistence() {
042 if (_persistence == null) {
043 _persistence =
044 (CyrusVirtualPersistence)PortalBeanLocatorUtil.locate(
045 CyrusVirtualPersistence.class.getName());
046 }
047
048 return _persistence;
049 }
050
051 public static void remove(String emailAddress)
052 throws NoSuchCyrusVirtualException, SystemException {
053
054 getPersistence().remove(emailAddress);
055 }
056
057 public static void removeByUserId(long userId) throws SystemException {
058 getPersistence().removeByUserId(userId);
059 }
060
061 public static void update(CyrusVirtual user) throws SystemException {
062 getPersistence().update(user);
063 }
064
065 public void setPersistence(CyrusVirtualPersistence persistence) {
066 _persistence = persistence;
067 }
068
069 private static CyrusVirtualPersistence _persistence;
070
071 }