001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.counter.service.persistence; 016 017 import com.liferay.counter.model.Counter; 018 019 import com.liferay.portal.service.persistence.BasePersistence; 020 021 /** 022 * The persistence interface for the counter service. 023 * 024 * <p> 025 * Caching information and settings can be found in <code>portal.properties</code> 026 * </p> 027 * 028 * @author Brian Wing Shun Chan 029 * @see CounterPersistenceImpl 030 * @see CounterUtil 031 * @generated 032 */ 033 public interface CounterPersistence extends BasePersistence<Counter> { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * 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. 038 */ 039 040 /** 041 * Caches the counter in the entity cache if it is enabled. 042 * 043 * @param counter the counter 044 */ 045 public void cacheResult(com.liferay.counter.model.Counter counter); 046 047 /** 048 * Caches the counters in the entity cache if it is enabled. 049 * 050 * @param counters the counters 051 */ 052 public void cacheResult( 053 java.util.List<com.liferay.counter.model.Counter> counters); 054 055 /** 056 * Creates a new counter with the primary key. Does not add the counter to the database. 057 * 058 * @param name the primary key for the new counter 059 * @return the new counter 060 */ 061 public com.liferay.counter.model.Counter create(java.lang.String name); 062 063 /** 064 * Removes the counter with the primary key from the database. Also notifies the appropriate model listeners. 065 * 066 * @param name the primary key of the counter 067 * @return the counter that was removed 068 * @throws com.liferay.counter.NoSuchCounterException if a counter with the primary key could not be found 069 * @throws SystemException if a system exception occurred 070 */ 071 public com.liferay.counter.model.Counter remove(java.lang.String name) 072 throws com.liferay.counter.NoSuchCounterException, 073 com.liferay.portal.kernel.exception.SystemException; 074 075 public com.liferay.counter.model.Counter updateImpl( 076 com.liferay.counter.model.Counter counter, boolean merge) 077 throws com.liferay.portal.kernel.exception.SystemException; 078 079 /** 080 * Returns the counter with the primary key or throws a {@link com.liferay.counter.NoSuchCounterException} if it could not be found. 081 * 082 * @param name the primary key of the counter 083 * @return the counter 084 * @throws com.liferay.counter.NoSuchCounterException if a counter with the primary key could not be found 085 * @throws SystemException if a system exception occurred 086 */ 087 public com.liferay.counter.model.Counter findByPrimaryKey( 088 java.lang.String name) 089 throws com.liferay.counter.NoSuchCounterException, 090 com.liferay.portal.kernel.exception.SystemException; 091 092 /** 093 * Returns the counter with the primary key or returns <code>null</code> if it could not be found. 094 * 095 * @param name the primary key of the counter 096 * @return the counter, or <code>null</code> if a counter with the primary key could not be found 097 * @throws SystemException if a system exception occurred 098 */ 099 public com.liferay.counter.model.Counter fetchByPrimaryKey( 100 java.lang.String name) 101 throws com.liferay.portal.kernel.exception.SystemException; 102 103 /** 104 * Returns all the counters. 105 * 106 * @return the counters 107 * @throws SystemException if a system exception occurred 108 */ 109 public java.util.List<com.liferay.counter.model.Counter> findAll() 110 throws com.liferay.portal.kernel.exception.SystemException; 111 112 /** 113 * Returns a range of all the counters. 114 * 115 * <p> 116 * 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. 117 * </p> 118 * 119 * @param start the lower bound of the range of counters 120 * @param end the upper bound of the range of counters (not inclusive) 121 * @return the range of counters 122 * @throws SystemException if a system exception occurred 123 */ 124 public java.util.List<com.liferay.counter.model.Counter> findAll( 125 int start, int end) 126 throws com.liferay.portal.kernel.exception.SystemException; 127 128 /** 129 * Returns an ordered range of all the counters. 130 * 131 * <p> 132 * 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. 133 * </p> 134 * 135 * @param start the lower bound of the range of counters 136 * @param end the upper bound of the range of counters (not inclusive) 137 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 138 * @return the ordered range of counters 139 * @throws SystemException if a system exception occurred 140 */ 141 public java.util.List<com.liferay.counter.model.Counter> findAll( 142 int start, int end, 143 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 144 throws com.liferay.portal.kernel.exception.SystemException; 145 146 /** 147 * Removes all the counters from the database. 148 * 149 * @throws SystemException if a system exception occurred 150 */ 151 public void removeAll() 152 throws com.liferay.portal.kernel.exception.SystemException; 153 154 /** 155 * Returns the number of counters. 156 * 157 * @return the number of counters 158 * @throws SystemException if a system exception occurred 159 */ 160 public int countAll() 161 throws com.liferay.portal.kernel.exception.SystemException; 162 }