001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.counter.service.persistence; 016 017 import com.liferay.counter.model.Counter; 018 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.service.persistence.BasePersistence; 021 022 /** 023 * The persistence interface for the counter service. 024 * 025 * <p> 026 * Caching information and settings can be found in <code>portal.properties</code> 027 * </p> 028 * 029 * @author Brian Wing Shun Chan 030 * @see CounterPersistenceImpl 031 * @see CounterUtil 032 * @generated 033 */ 034 public interface CounterPersistence extends BasePersistence<Counter> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify or reference this interface directly. Always use {@link CounterUtil} to access the counter persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 039 */ 040 041 /** 042 * Caches the counter in the entity cache if it is enabled. 043 * 044 * @param counter the counter 045 */ 046 public void cacheResult(com.liferay.counter.model.Counter counter); 047 048 /** 049 * Caches the counters in the entity cache if it is enabled. 050 * 051 * @param counters the counters 052 */ 053 public void cacheResult( 054 java.util.List<com.liferay.counter.model.Counter> counters); 055 056 /** 057 * Creates a new counter with the primary key. Does not add the counter to the database. 058 * 059 * @param name the primary key for the new counter 060 * @return the new counter 061 */ 062 public com.liferay.counter.model.Counter create(java.lang.String name); 063 064 /** 065 * Removes the counter with the primary key from the database. Also notifies the appropriate model listeners. 066 * 067 * @param name the primary key of the counter 068 * @return the counter that was removed 069 * @throws com.liferay.counter.NoSuchCounterException if a counter with the primary key could not be found 070 * @throws SystemException if a system exception occurred 071 */ 072 public com.liferay.counter.model.Counter remove(java.lang.String name) 073 throws com.liferay.counter.NoSuchCounterException, 074 com.liferay.portal.kernel.exception.SystemException; 075 076 public com.liferay.counter.model.Counter updateImpl( 077 com.liferay.counter.model.Counter counter, boolean merge) 078 throws com.liferay.portal.kernel.exception.SystemException; 079 080 /** 081 * Returns the counter with the primary key or throws a {@link com.liferay.counter.NoSuchCounterException} if it could not be found. 082 * 083 * @param name the primary key of the counter 084 * @return the counter 085 * @throws com.liferay.counter.NoSuchCounterException if a counter with the primary key could not be found 086 * @throws SystemException if a system exception occurred 087 */ 088 public com.liferay.counter.model.Counter findByPrimaryKey( 089 java.lang.String name) 090 throws com.liferay.counter.NoSuchCounterException, 091 com.liferay.portal.kernel.exception.SystemException; 092 093 /** 094 * Returns the counter with the primary key or returns <code>null</code> if it could not be found. 095 * 096 * @param name the primary key of the counter 097 * @return the counter, or <code>null</code> if a counter with the primary key could not be found 098 * @throws SystemException if a system exception occurred 099 */ 100 public com.liferay.counter.model.Counter fetchByPrimaryKey( 101 java.lang.String name) 102 throws com.liferay.portal.kernel.exception.SystemException; 103 104 /** 105 * Returns all the counters. 106 * 107 * @return the counters 108 * @throws SystemException if a system exception occurred 109 */ 110 public java.util.List<com.liferay.counter.model.Counter> findAll() 111 throws com.liferay.portal.kernel.exception.SystemException; 112 113 /** 114 * Returns a range of all the counters. 115 * 116 * <p> 117 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 118 * </p> 119 * 120 * @param start the lower bound of the range of counters 121 * @param end the upper bound of the range of counters (not inclusive) 122 * @return the range of counters 123 * @throws SystemException if a system exception occurred 124 */ 125 public java.util.List<com.liferay.counter.model.Counter> findAll( 126 int start, int end) 127 throws com.liferay.portal.kernel.exception.SystemException; 128 129 /** 130 * Returns an ordered range of all the counters. 131 * 132 * <p> 133 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 134 * </p> 135 * 136 * @param start the lower bound of the range of counters 137 * @param end the upper bound of the range of counters (not inclusive) 138 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 139 * @return the ordered range of counters 140 * @throws SystemException if a system exception occurred 141 */ 142 public java.util.List<com.liferay.counter.model.Counter> findAll( 143 int start, int end, 144 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 145 throws com.liferay.portal.kernel.exception.SystemException; 146 147 /** 148 * Removes all the counters from the database. 149 * 150 * @throws SystemException if a system exception occurred 151 */ 152 public void removeAll() 153 throws com.liferay.portal.kernel.exception.SystemException; 154 155 /** 156 * Returns the number of counters. 157 * 158 * @return the number of counters 159 * @throws SystemException if a system exception occurred 160 */ 161 public int countAll() 162 throws com.liferay.portal.kernel.exception.SystemException; 163 164 public Counter remove(Counter counter) throws SystemException; 165 }