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 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(com.liferay.counter.model.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( 056 java.util.List<com.liferay.counter.model.Counter> counters); 057 058 /** 059 * Creates a new counter with the primary key. Does not add the counter to the database. 060 * 061 * @param name the primary key for the new counter 062 * @return the new counter 063 */ 064 public com.liferay.counter.model.Counter create(java.lang.String name); 065 066 /** 067 * Removes the counter with the primary key from the database. Also notifies the appropriate model listeners. 068 * 069 * @param name the primary key of the counter 070 * @return the counter that was removed 071 * @throws com.liferay.counter.NoSuchCounterException if a counter with the primary key could not be found 072 */ 073 public com.liferay.counter.model.Counter remove(java.lang.String name) 074 throws com.liferay.counter.NoSuchCounterException; 075 076 public com.liferay.counter.model.Counter updateImpl( 077 com.liferay.counter.model.Counter counter); 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 */ 086 public com.liferay.counter.model.Counter findByPrimaryKey( 087 java.lang.String name) 088 throws com.liferay.counter.NoSuchCounterException; 089 090 /** 091 * Returns the counter with the primary key or returns <code>null</code> if it could not be found. 092 * 093 * @param name the primary key of the counter 094 * @return the counter, or <code>null</code> if a counter with the primary key could not be found 095 */ 096 public com.liferay.counter.model.Counter fetchByPrimaryKey( 097 java.lang.String name); 098 099 @Override 100 public java.util.Map<java.io.Serializable, com.liferay.counter.model.Counter> fetchByPrimaryKeys( 101 java.util.Set<java.io.Serializable> primaryKeys); 102 103 /** 104 * Returns all the counters. 105 * 106 * @return the counters 107 */ 108 public java.util.List<com.liferay.counter.model.Counter> findAll(); 109 110 /** 111 * Returns a range of all the counters. 112 * 113 * <p> 114 * 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. 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.counter.model.impl.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. 115 * </p> 116 * 117 * @param start the lower bound of the range of counters 118 * @param end the upper bound of the range of counters (not inclusive) 119 * @return the range of counters 120 */ 121 public java.util.List<com.liferay.counter.model.Counter> findAll( 122 int start, int end); 123 124 /** 125 * Returns an ordered range of all the counters. 126 * 127 * <p> 128 * 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. 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.counter.model.impl.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. 129 * </p> 130 * 131 * @param start the lower bound of the range of counters 132 * @param end the upper bound of the range of counters (not inclusive) 133 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 134 * @return the ordered range of counters 135 */ 136 public java.util.List<com.liferay.counter.model.Counter> findAll( 137 int start, int end, 138 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.counter.model.Counter> orderByComparator); 139 140 /** 141 * Removes all the counters from the database. 142 */ 143 public void removeAll(); 144 145 /** 146 * Returns the number of counters. 147 * 148 * @return the number of counters 149 */ 150 public int countAll(); 151 }