1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * 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   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="ClassNameUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class ClassNameUtil {
32      public static com.liferay.portal.model.ClassName create(long classNameId) {
33          return getPersistence().create(classNameId);
34      }
35  
36      public static com.liferay.portal.model.ClassName remove(long classNameId)
37          throws com.liferay.portal.SystemException, 
38              com.liferay.portal.NoSuchClassNameException {
39          return getPersistence().remove(classNameId);
40      }
41  
42      public static com.liferay.portal.model.ClassName remove(
43          com.liferay.portal.model.ClassName className)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(className);
46      }
47  
48      public static com.liferay.portal.model.ClassName update(
49          com.liferay.portal.model.ClassName className)
50          throws com.liferay.portal.SystemException {
51          return getPersistence().update(className);
52      }
53  
54      public static com.liferay.portal.model.ClassName update(
55          com.liferay.portal.model.ClassName className, boolean merge)
56          throws com.liferay.portal.SystemException {
57          return getPersistence().update(className, merge);
58      }
59  
60      public static com.liferay.portal.model.ClassName updateImpl(
61          com.liferay.portal.model.ClassName className, boolean merge)
62          throws com.liferay.portal.SystemException {
63          return getPersistence().updateImpl(className, merge);
64      }
65  
66      public static com.liferay.portal.model.ClassName findByPrimaryKey(
67          long classNameId)
68          throws com.liferay.portal.SystemException, 
69              com.liferay.portal.NoSuchClassNameException {
70          return getPersistence().findByPrimaryKey(classNameId);
71      }
72  
73      public static com.liferay.portal.model.ClassName fetchByPrimaryKey(
74          long classNameId) throws com.liferay.portal.SystemException {
75          return getPersistence().fetchByPrimaryKey(classNameId);
76      }
77  
78      public static com.liferay.portal.model.ClassName findByValue(
79          java.lang.String value)
80          throws com.liferay.portal.SystemException, 
81              com.liferay.portal.NoSuchClassNameException {
82          return getPersistence().findByValue(value);
83      }
84  
85      public static com.liferay.portal.model.ClassName fetchByValue(
86          java.lang.String value) throws com.liferay.portal.SystemException {
87          return getPersistence().fetchByValue(value);
88      }
89  
90      public static java.util.List findWithDynamicQuery(
91          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().findWithDynamicQuery(queryInitializer);
94      }
95  
96      public static java.util.List findWithDynamicQuery(
97          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
98          int begin, int end) throws com.liferay.portal.SystemException {
99          return getPersistence().findWithDynamicQuery(queryInitializer, begin,
100             end);
101     }
102 
103     public static java.util.List findAll()
104         throws com.liferay.portal.SystemException {
105         return getPersistence().findAll();
106     }
107 
108     public static java.util.List findAll(int begin, int end)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().findAll(begin, end);
111     }
112 
113     public static java.util.List findAll(int begin, int end,
114         com.liferay.portal.kernel.util.OrderByComparator obc)
115         throws com.liferay.portal.SystemException {
116         return getPersistence().findAll(begin, end, obc);
117     }
118 
119     public static void removeByValue(java.lang.String value)
120         throws com.liferay.portal.SystemException, 
121             com.liferay.portal.NoSuchClassNameException {
122         getPersistence().removeByValue(value);
123     }
124 
125     public static void removeAll() throws com.liferay.portal.SystemException {
126         getPersistence().removeAll();
127     }
128 
129     public static int countByValue(java.lang.String value)
130         throws com.liferay.portal.SystemException {
131         return getPersistence().countByValue(value);
132     }
133 
134     public static int countAll() throws com.liferay.portal.SystemException {
135         return getPersistence().countAll();
136     }
137 
138     public static ClassNamePersistence getPersistence() {
139         return _getUtil()._persistence;
140     }
141 
142     public void setPersistence(ClassNamePersistence persistence) {
143         _persistence = persistence;
144     }
145 
146     private static ClassNameUtil _getUtil() {
147         if (_util == null) {
148             _util = (ClassNameUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
149         }
150 
151         return _util;
152     }
153 
154     private static final String _UTIL = ClassNameUtil.class.getName();
155     private static ClassNameUtil _util;
156     private ClassNamePersistence _persistence;
157 }