001 /** 002 * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.counter.model.Counter; 020 021 import com.liferay.portal.service.persistence.BasePersistence; 022 023 /** 024 * The persistence interface for the counter service. 025 * 026 * <p> 027 * Caching information and settings can be found in <code>portal.properties</code> 028 * </p> 029 * 030 * @author Brian Wing Shun Chan 031 * @see com.liferay.counter.service.persistence.impl.CounterPersistenceImpl 032 * @see CounterUtil 033 * @generated 034 */ 035 @ProviderType 036 public interface CounterPersistence extends BasePersistence<Counter> { 037 /* 038 * NOTE FOR DEVELOPERS: 039 * 040 * 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. 041 */ 042 043 /** 044 * Caches the counter in the entity cache if it is enabled. 045 * 046 * @param counter the counter 047 */ 048 public void cacheResult(Counter counter); 049 050 /** 051 * Caches the counters in the entity cache if it is enabled. 052 * 053 * @param counters the counters 054 */ 055 public void cacheResult(java.util.List<Counter> counters); 056 057 /** 058 * Creates a new counter with the primary key. Does not add the counter to the database. 059 * 060 * @param name the primary key for the new counter 061 * @return the new counter 062 */ 063 public Counter create(java.lang.String name); 064 065 /** 066 * Removes the counter with the primary key from the database. Also notifies the appropriate model listeners. 067 * 068 * @param name the primary key of the counter 069 * @return the counter that was removed 070 * @throws NoSuchCounterException if a counter with the primary key could not be found 071 */ 072 public Counter remove(java.lang.String name) 073 throws com.liferay.counter.exception.NoSuchCounterException; 074 075 public Counter updateImpl(Counter counter); 076 077 /** 078 * Returns the counter with the primary key or throws a {@link NoSuchCounterException} if it could not be found. 079 * 080 * @param name the primary key of the counter 081 * @return the counter 082 * @throws NoSuchCounterException if a counter with the primary key could not be found 083 */ 084 public Counter findByPrimaryKey(java.lang.String name) 085 throws com.liferay.counter.exception.NoSuchCounterException; 086 087 /** 088 * Returns the counter with the primary key or returns <code>null</code> if it could not be found. 089 * 090 * @param name the primary key of the counter 091 * @return the counter, or <code>null</code> if a counter with the primary key could not be found 092 */ 093 public Counter fetchByPrimaryKey(java.lang.String name); 094 095 @Override 096 public java.util.Map<java.io.Serializable, Counter> fetchByPrimaryKeys( 097 java.util.Set<java.io.Serializable> primaryKeys); 098 099 /** 100 * Returns all the counters. 101 * 102 * @return the counters 103 */ 104 public java.util.List<Counter> findAll(); 105 106 /** 107 * Returns a range of all the counters. 108 * 109 * <p> 110 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CounterModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 111 * </p> 112 * 113 * @param start the lower bound of the range of counters 114 * @param end the upper bound of the range of counters (not inclusive) 115 * @return the range of counters 116 */ 117 public java.util.List<Counter> findAll(int start, int end); 118 119 /** 120 * Returns an ordered range of all the counters. 121 * 122 * <p> 123 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CounterModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 124 * </p> 125 * 126 * @param start the lower bound of the range of counters 127 * @param end the upper bound of the range of counters (not inclusive) 128 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 129 * @return the ordered range of counters 130 */ 131 public java.util.List<Counter> findAll(int start, int end, 132 com.liferay.portal.kernel.util.OrderByComparator<Counter> orderByComparator); 133 134 /** 135 * Returns an ordered range of all the counters. 136 * 137 * <p> 138 * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CounterModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 139 * </p> 140 * 141 * @param start the lower bound of the range of counters 142 * @param end the upper bound of the range of counters (not inclusive) 143 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 144 * @param retrieveFromCache whether to retrieve from the finder cache 145 * @return the ordered range of counters 146 */ 147 public java.util.List<Counter> findAll(int start, int end, 148 com.liferay.portal.kernel.util.OrderByComparator<Counter> orderByComparator, 149 boolean retrieveFromCache); 150 151 /** 152 * Removes all the counters from the database. 153 */ 154 public void removeAll(); 155 156 /** 157 * Returns the number of counters. 158 * 159 * @return the number of counters 160 */ 161 public int countAll(); 162 }