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.portlet.shopping.service.persistence.impl;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
020    import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
021    import com.liferay.portal.kernel.dao.orm.FinderPath;
022    import com.liferay.portal.kernel.dao.orm.Query;
023    import com.liferay.portal.kernel.dao.orm.QueryPos;
024    import com.liferay.portal.kernel.dao.orm.QueryUtil;
025    import com.liferay.portal.kernel.dao.orm.Session;
026    import com.liferay.portal.kernel.log.Log;
027    import com.liferay.portal.kernel.log.LogFactoryUtil;
028    import com.liferay.portal.kernel.util.OrderByComparator;
029    import com.liferay.portal.kernel.util.StringBundler;
030    import com.liferay.portal.kernel.util.StringPool;
031    import com.liferay.portal.model.CacheModel;
032    import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
033    
034    import com.liferay.portlet.shopping.NoSuchItemPriceException;
035    import com.liferay.portlet.shopping.model.ShoppingItemPrice;
036    import com.liferay.portlet.shopping.model.impl.ShoppingItemPriceImpl;
037    import com.liferay.portlet.shopping.model.impl.ShoppingItemPriceModelImpl;
038    import com.liferay.portlet.shopping.service.persistence.ShoppingItemPricePersistence;
039    
040    import java.io.Serializable;
041    
042    import java.util.Collections;
043    import java.util.HashMap;
044    import java.util.HashSet;
045    import java.util.Iterator;
046    import java.util.List;
047    import java.util.Map;
048    import java.util.Set;
049    
050    /**
051     * The persistence implementation for the shopping item price service.
052     *
053     * <p>
054     * Caching information and settings can be found in <code>portal.properties</code>
055     * </p>
056     *
057     * @author Brian Wing Shun Chan
058     * @see ShoppingItemPricePersistence
059     * @see com.liferay.portlet.shopping.service.persistence.ShoppingItemPriceUtil
060     * @generated
061     */
062    @ProviderType
063    public class ShoppingItemPricePersistenceImpl extends BasePersistenceImpl<ShoppingItemPrice>
064            implements ShoppingItemPricePersistence {
065            /*
066             * NOTE FOR DEVELOPERS:
067             *
068             * Never modify or reference this class directly. Always use {@link ShoppingItemPriceUtil} to access the shopping item price persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
069             */
070            public static final String FINDER_CLASS_NAME_ENTITY = ShoppingItemPriceImpl.class.getName();
071            public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
072                    ".List1";
073            public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
074                    ".List2";
075            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
076                            ShoppingItemPriceModelImpl.FINDER_CACHE_ENABLED,
077                            ShoppingItemPriceImpl.class,
078                            FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
079            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
080                            ShoppingItemPriceModelImpl.FINDER_CACHE_ENABLED,
081                            ShoppingItemPriceImpl.class,
082                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
083            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
084                            ShoppingItemPriceModelImpl.FINDER_CACHE_ENABLED, Long.class,
085                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
086            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_ITEMID = new FinderPath(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
087                            ShoppingItemPriceModelImpl.FINDER_CACHE_ENABLED,
088                            ShoppingItemPriceImpl.class,
089                            FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByItemId",
090                            new String[] {
091                                    Long.class.getName(),
092                                    
093                            Integer.class.getName(), Integer.class.getName(),
094                                    OrderByComparator.class.getName()
095                            });
096            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID =
097                    new FinderPath(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
098                            ShoppingItemPriceModelImpl.FINDER_CACHE_ENABLED,
099                            ShoppingItemPriceImpl.class,
100                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByItemId",
101                            new String[] { Long.class.getName() },
102                            ShoppingItemPriceModelImpl.ITEMID_COLUMN_BITMASK);
103            public static final FinderPath FINDER_PATH_COUNT_BY_ITEMID = new FinderPath(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
104                            ShoppingItemPriceModelImpl.FINDER_CACHE_ENABLED, Long.class,
105                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByItemId",
106                            new String[] { Long.class.getName() });
107    
108            /**
109             * Returns all the shopping item prices where itemId = &#63;.
110             *
111             * @param itemId the item ID
112             * @return the matching shopping item prices
113             */
114            @Override
115            public List<ShoppingItemPrice> findByItemId(long itemId) {
116                    return findByItemId(itemId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
117            }
118    
119            /**
120             * Returns a range of all the shopping item prices where itemId = &#63;.
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 ShoppingItemPriceModelImpl}. 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 itemId the item ID
127             * @param start the lower bound of the range of shopping item prices
128             * @param end the upper bound of the range of shopping item prices (not inclusive)
129             * @return the range of matching shopping item prices
130             */
131            @Override
132            public List<ShoppingItemPrice> findByItemId(long itemId, int start, int end) {
133                    return findByItemId(itemId, start, end, null);
134            }
135    
136            /**
137             * Returns an ordered range of all the shopping item prices where itemId = &#63;.
138             *
139             * <p>
140             * 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 ShoppingItemPriceModelImpl}. 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.
141             * </p>
142             *
143             * @param itemId the item ID
144             * @param start the lower bound of the range of shopping item prices
145             * @param end the upper bound of the range of shopping item prices (not inclusive)
146             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
147             * @return the ordered range of matching shopping item prices
148             */
149            @Override
150            public List<ShoppingItemPrice> findByItemId(long itemId, int start,
151                    int end, OrderByComparator<ShoppingItemPrice> orderByComparator) {
152                    boolean pagination = true;
153                    FinderPath finderPath = null;
154                    Object[] finderArgs = null;
155    
156                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
157                                    (orderByComparator == null)) {
158                            pagination = false;
159                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID;
160                            finderArgs = new Object[] { itemId };
161                    }
162                    else {
163                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_ITEMID;
164                            finderArgs = new Object[] { itemId, start, end, orderByComparator };
165                    }
166    
167                    List<ShoppingItemPrice> list = (List<ShoppingItemPrice>)FinderCacheUtil.getResult(finderPath,
168                                    finderArgs, this);
169    
170                    if ((list != null) && !list.isEmpty()) {
171                            for (ShoppingItemPrice shoppingItemPrice : list) {
172                                    if ((itemId != shoppingItemPrice.getItemId())) {
173                                            list = null;
174    
175                                            break;
176                                    }
177                            }
178                    }
179    
180                    if (list == null) {
181                            StringBundler query = null;
182    
183                            if (orderByComparator != null) {
184                                    query = new StringBundler(3 +
185                                                    (orderByComparator.getOrderByFields().length * 3));
186                            }
187                            else {
188                                    query = new StringBundler(3);
189                            }
190    
191                            query.append(_SQL_SELECT_SHOPPINGITEMPRICE_WHERE);
192    
193                            query.append(_FINDER_COLUMN_ITEMID_ITEMID_2);
194    
195                            if (orderByComparator != null) {
196                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
197                                            orderByComparator);
198                            }
199                            else
200                             if (pagination) {
201                                    query.append(ShoppingItemPriceModelImpl.ORDER_BY_JPQL);
202                            }
203    
204                            String sql = query.toString();
205    
206                            Session session = null;
207    
208                            try {
209                                    session = openSession();
210    
211                                    Query q = session.createQuery(sql);
212    
213                                    QueryPos qPos = QueryPos.getInstance(q);
214    
215                                    qPos.add(itemId);
216    
217                                    if (!pagination) {
218                                            list = (List<ShoppingItemPrice>)QueryUtil.list(q,
219                                                            getDialect(), start, end, false);
220    
221                                            Collections.sort(list);
222    
223                                            list = Collections.unmodifiableList(list);
224                                    }
225                                    else {
226                                            list = (List<ShoppingItemPrice>)QueryUtil.list(q,
227                                                            getDialect(), start, end);
228                                    }
229    
230                                    cacheResult(list);
231    
232                                    FinderCacheUtil.putResult(finderPath, finderArgs, list);
233                            }
234                            catch (Exception e) {
235                                    FinderCacheUtil.removeResult(finderPath, finderArgs);
236    
237                                    throw processException(e);
238                            }
239                            finally {
240                                    closeSession(session);
241                            }
242                    }
243    
244                    return list;
245            }
246    
247            /**
248             * Returns the first shopping item price in the ordered set where itemId = &#63;.
249             *
250             * @param itemId the item ID
251             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
252             * @return the first matching shopping item price
253             * @throws NoSuchItemPriceException if a matching shopping item price could not be found
254             */
255            @Override
256            public ShoppingItemPrice findByItemId_First(long itemId,
257                    OrderByComparator<ShoppingItemPrice> orderByComparator)
258                    throws NoSuchItemPriceException {
259                    ShoppingItemPrice shoppingItemPrice = fetchByItemId_First(itemId,
260                                    orderByComparator);
261    
262                    if (shoppingItemPrice != null) {
263                            return shoppingItemPrice;
264                    }
265    
266                    StringBundler msg = new StringBundler(4);
267    
268                    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
269    
270                    msg.append("itemId=");
271                    msg.append(itemId);
272    
273                    msg.append(StringPool.CLOSE_CURLY_BRACE);
274    
275                    throw new NoSuchItemPriceException(msg.toString());
276            }
277    
278            /**
279             * Returns the first shopping item price in the ordered set where itemId = &#63;.
280             *
281             * @param itemId the item ID
282             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
283             * @return the first matching shopping item price, or <code>null</code> if a matching shopping item price could not be found
284             */
285            @Override
286            public ShoppingItemPrice fetchByItemId_First(long itemId,
287                    OrderByComparator<ShoppingItemPrice> orderByComparator) {
288                    List<ShoppingItemPrice> list = findByItemId(itemId, 0, 1,
289                                    orderByComparator);
290    
291                    if (!list.isEmpty()) {
292                            return list.get(0);
293                    }
294    
295                    return null;
296            }
297    
298            /**
299             * Returns the last shopping item price in the ordered set where itemId = &#63;.
300             *
301             * @param itemId the item ID
302             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
303             * @return the last matching shopping item price
304             * @throws NoSuchItemPriceException if a matching shopping item price could not be found
305             */
306            @Override
307            public ShoppingItemPrice findByItemId_Last(long itemId,
308                    OrderByComparator<ShoppingItemPrice> orderByComparator)
309                    throws NoSuchItemPriceException {
310                    ShoppingItemPrice shoppingItemPrice = fetchByItemId_Last(itemId,
311                                    orderByComparator);
312    
313                    if (shoppingItemPrice != null) {
314                            return shoppingItemPrice;
315                    }
316    
317                    StringBundler msg = new StringBundler(4);
318    
319                    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
320    
321                    msg.append("itemId=");
322                    msg.append(itemId);
323    
324                    msg.append(StringPool.CLOSE_CURLY_BRACE);
325    
326                    throw new NoSuchItemPriceException(msg.toString());
327            }
328    
329            /**
330             * Returns the last shopping item price in the ordered set where itemId = &#63;.
331             *
332             * @param itemId the item ID
333             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
334             * @return the last matching shopping item price, or <code>null</code> if a matching shopping item price could not be found
335             */
336            @Override
337            public ShoppingItemPrice fetchByItemId_Last(long itemId,
338                    OrderByComparator<ShoppingItemPrice> orderByComparator) {
339                    int count = countByItemId(itemId);
340    
341                    if (count == 0) {
342                            return null;
343                    }
344    
345                    List<ShoppingItemPrice> list = findByItemId(itemId, count - 1, count,
346                                    orderByComparator);
347    
348                    if (!list.isEmpty()) {
349                            return list.get(0);
350                    }
351    
352                    return null;
353            }
354    
355            /**
356             * Returns the shopping item prices before and after the current shopping item price in the ordered set where itemId = &#63;.
357             *
358             * @param itemPriceId the primary key of the current shopping item price
359             * @param itemId the item ID
360             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
361             * @return the previous, current, and next shopping item price
362             * @throws NoSuchItemPriceException if a shopping item price with the primary key could not be found
363             */
364            @Override
365            public ShoppingItemPrice[] findByItemId_PrevAndNext(long itemPriceId,
366                    long itemId, OrderByComparator<ShoppingItemPrice> orderByComparator)
367                    throws NoSuchItemPriceException {
368                    ShoppingItemPrice shoppingItemPrice = findByPrimaryKey(itemPriceId);
369    
370                    Session session = null;
371    
372                    try {
373                            session = openSession();
374    
375                            ShoppingItemPrice[] array = new ShoppingItemPriceImpl[3];
376    
377                            array[0] = getByItemId_PrevAndNext(session, shoppingItemPrice,
378                                            itemId, orderByComparator, true);
379    
380                            array[1] = shoppingItemPrice;
381    
382                            array[2] = getByItemId_PrevAndNext(session, shoppingItemPrice,
383                                            itemId, orderByComparator, false);
384    
385                            return array;
386                    }
387                    catch (Exception e) {
388                            throw processException(e);
389                    }
390                    finally {
391                            closeSession(session);
392                    }
393            }
394    
395            protected ShoppingItemPrice getByItemId_PrevAndNext(Session session,
396                    ShoppingItemPrice shoppingItemPrice, long itemId,
397                    OrderByComparator<ShoppingItemPrice> orderByComparator, boolean previous) {
398                    StringBundler query = null;
399    
400                    if (orderByComparator != null) {
401                            query = new StringBundler(6 +
402                                            (orderByComparator.getOrderByFields().length * 6));
403                    }
404                    else {
405                            query = new StringBundler(3);
406                    }
407    
408                    query.append(_SQL_SELECT_SHOPPINGITEMPRICE_WHERE);
409    
410                    query.append(_FINDER_COLUMN_ITEMID_ITEMID_2);
411    
412                    if (orderByComparator != null) {
413                            String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
414    
415                            if (orderByConditionFields.length > 0) {
416                                    query.append(WHERE_AND);
417                            }
418    
419                            for (int i = 0; i < orderByConditionFields.length; i++) {
420                                    query.append(_ORDER_BY_ENTITY_ALIAS);
421                                    query.append(orderByConditionFields[i]);
422    
423                                    if ((i + 1) < orderByConditionFields.length) {
424                                            if (orderByComparator.isAscending() ^ previous) {
425                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
426                                            }
427                                            else {
428                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
429                                            }
430                                    }
431                                    else {
432                                            if (orderByComparator.isAscending() ^ previous) {
433                                                    query.append(WHERE_GREATER_THAN);
434                                            }
435                                            else {
436                                                    query.append(WHERE_LESSER_THAN);
437                                            }
438                                    }
439                            }
440    
441                            query.append(ORDER_BY_CLAUSE);
442    
443                            String[] orderByFields = orderByComparator.getOrderByFields();
444    
445                            for (int i = 0; i < orderByFields.length; i++) {
446                                    query.append(_ORDER_BY_ENTITY_ALIAS);
447                                    query.append(orderByFields[i]);
448    
449                                    if ((i + 1) < orderByFields.length) {
450                                            if (orderByComparator.isAscending() ^ previous) {
451                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
452                                            }
453                                            else {
454                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
455                                            }
456                                    }
457                                    else {
458                                            if (orderByComparator.isAscending() ^ previous) {
459                                                    query.append(ORDER_BY_ASC);
460                                            }
461                                            else {
462                                                    query.append(ORDER_BY_DESC);
463                                            }
464                                    }
465                            }
466                    }
467                    else {
468                            query.append(ShoppingItemPriceModelImpl.ORDER_BY_JPQL);
469                    }
470    
471                    String sql = query.toString();
472    
473                    Query q = session.createQuery(sql);
474    
475                    q.setFirstResult(0);
476                    q.setMaxResults(2);
477    
478                    QueryPos qPos = QueryPos.getInstance(q);
479    
480                    qPos.add(itemId);
481    
482                    if (orderByComparator != null) {
483                            Object[] values = orderByComparator.getOrderByConditionValues(shoppingItemPrice);
484    
485                            for (Object value : values) {
486                                    qPos.add(value);
487                            }
488                    }
489    
490                    List<ShoppingItemPrice> list = q.list();
491    
492                    if (list.size() == 2) {
493                            return list.get(1);
494                    }
495                    else {
496                            return null;
497                    }
498            }
499    
500            /**
501             * Removes all the shopping item prices where itemId = &#63; from the database.
502             *
503             * @param itemId the item ID
504             */
505            @Override
506            public void removeByItemId(long itemId) {
507                    for (ShoppingItemPrice shoppingItemPrice : findByItemId(itemId,
508                                    QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
509                            remove(shoppingItemPrice);
510                    }
511            }
512    
513            /**
514             * Returns the number of shopping item prices where itemId = &#63;.
515             *
516             * @param itemId the item ID
517             * @return the number of matching shopping item prices
518             */
519            @Override
520            public int countByItemId(long itemId) {
521                    FinderPath finderPath = FINDER_PATH_COUNT_BY_ITEMID;
522    
523                    Object[] finderArgs = new Object[] { itemId };
524    
525                    Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs,
526                                    this);
527    
528                    if (count == null) {
529                            StringBundler query = new StringBundler(2);
530    
531                            query.append(_SQL_COUNT_SHOPPINGITEMPRICE_WHERE);
532    
533                            query.append(_FINDER_COLUMN_ITEMID_ITEMID_2);
534    
535                            String sql = query.toString();
536    
537                            Session session = null;
538    
539                            try {
540                                    session = openSession();
541    
542                                    Query q = session.createQuery(sql);
543    
544                                    QueryPos qPos = QueryPos.getInstance(q);
545    
546                                    qPos.add(itemId);
547    
548                                    count = (Long)q.uniqueResult();
549    
550                                    FinderCacheUtil.putResult(finderPath, finderArgs, count);
551                            }
552                            catch (Exception e) {
553                                    FinderCacheUtil.removeResult(finderPath, finderArgs);
554    
555                                    throw processException(e);
556                            }
557                            finally {
558                                    closeSession(session);
559                            }
560                    }
561    
562                    return count.intValue();
563            }
564    
565            private static final String _FINDER_COLUMN_ITEMID_ITEMID_2 = "shoppingItemPrice.itemId = ?";
566    
567            public ShoppingItemPricePersistenceImpl() {
568                    setModelClass(ShoppingItemPrice.class);
569            }
570    
571            /**
572             * Caches the shopping item price in the entity cache if it is enabled.
573             *
574             * @param shoppingItemPrice the shopping item price
575             */
576            @Override
577            public void cacheResult(ShoppingItemPrice shoppingItemPrice) {
578                    EntityCacheUtil.putResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
579                            ShoppingItemPriceImpl.class, shoppingItemPrice.getPrimaryKey(),
580                            shoppingItemPrice);
581    
582                    shoppingItemPrice.resetOriginalValues();
583            }
584    
585            /**
586             * Caches the shopping item prices in the entity cache if it is enabled.
587             *
588             * @param shoppingItemPrices the shopping item prices
589             */
590            @Override
591            public void cacheResult(List<ShoppingItemPrice> shoppingItemPrices) {
592                    for (ShoppingItemPrice shoppingItemPrice : shoppingItemPrices) {
593                            if (EntityCacheUtil.getResult(
594                                                    ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
595                                                    ShoppingItemPriceImpl.class,
596                                                    shoppingItemPrice.getPrimaryKey()) == null) {
597                                    cacheResult(shoppingItemPrice);
598                            }
599                            else {
600                                    shoppingItemPrice.resetOriginalValues();
601                            }
602                    }
603            }
604    
605            /**
606             * Clears the cache for all shopping item prices.
607             *
608             * <p>
609             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
610             * </p>
611             */
612            @Override
613            public void clearCache() {
614                    EntityCacheUtil.clearCache(ShoppingItemPriceImpl.class);
615    
616                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
617                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
618                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
619            }
620    
621            /**
622             * Clears the cache for the shopping item price.
623             *
624             * <p>
625             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
626             * </p>
627             */
628            @Override
629            public void clearCache(ShoppingItemPrice shoppingItemPrice) {
630                    EntityCacheUtil.removeResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
631                            ShoppingItemPriceImpl.class, shoppingItemPrice.getPrimaryKey());
632    
633                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
634                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
635            }
636    
637            @Override
638            public void clearCache(List<ShoppingItemPrice> shoppingItemPrices) {
639                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
640                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
641    
642                    for (ShoppingItemPrice shoppingItemPrice : shoppingItemPrices) {
643                            EntityCacheUtil.removeResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
644                                    ShoppingItemPriceImpl.class, shoppingItemPrice.getPrimaryKey());
645                    }
646            }
647    
648            /**
649             * Creates a new shopping item price with the primary key. Does not add the shopping item price to the database.
650             *
651             * @param itemPriceId the primary key for the new shopping item price
652             * @return the new shopping item price
653             */
654            @Override
655            public ShoppingItemPrice create(long itemPriceId) {
656                    ShoppingItemPrice shoppingItemPrice = new ShoppingItemPriceImpl();
657    
658                    shoppingItemPrice.setNew(true);
659                    shoppingItemPrice.setPrimaryKey(itemPriceId);
660    
661                    return shoppingItemPrice;
662            }
663    
664            /**
665             * Removes the shopping item price with the primary key from the database. Also notifies the appropriate model listeners.
666             *
667             * @param itemPriceId the primary key of the shopping item price
668             * @return the shopping item price that was removed
669             * @throws NoSuchItemPriceException if a shopping item price with the primary key could not be found
670             */
671            @Override
672            public ShoppingItemPrice remove(long itemPriceId)
673                    throws NoSuchItemPriceException {
674                    return remove((Serializable)itemPriceId);
675            }
676    
677            /**
678             * Removes the shopping item price with the primary key from the database. Also notifies the appropriate model listeners.
679             *
680             * @param primaryKey the primary key of the shopping item price
681             * @return the shopping item price that was removed
682             * @throws NoSuchItemPriceException if a shopping item price with the primary key could not be found
683             */
684            @Override
685            public ShoppingItemPrice remove(Serializable primaryKey)
686                    throws NoSuchItemPriceException {
687                    Session session = null;
688    
689                    try {
690                            session = openSession();
691    
692                            ShoppingItemPrice shoppingItemPrice = (ShoppingItemPrice)session.get(ShoppingItemPriceImpl.class,
693                                            primaryKey);
694    
695                            if (shoppingItemPrice == null) {
696                                    if (_log.isWarnEnabled()) {
697                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
698                                    }
699    
700                                    throw new NoSuchItemPriceException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
701                                            primaryKey);
702                            }
703    
704                            return remove(shoppingItemPrice);
705                    }
706                    catch (NoSuchItemPriceException nsee) {
707                            throw nsee;
708                    }
709                    catch (Exception e) {
710                            throw processException(e);
711                    }
712                    finally {
713                            closeSession(session);
714                    }
715            }
716    
717            @Override
718            protected ShoppingItemPrice removeImpl(ShoppingItemPrice shoppingItemPrice) {
719                    shoppingItemPrice = toUnwrappedModel(shoppingItemPrice);
720    
721                    Session session = null;
722    
723                    try {
724                            session = openSession();
725    
726                            if (!session.contains(shoppingItemPrice)) {
727                                    shoppingItemPrice = (ShoppingItemPrice)session.get(ShoppingItemPriceImpl.class,
728                                                    shoppingItemPrice.getPrimaryKeyObj());
729                            }
730    
731                            if (shoppingItemPrice != null) {
732                                    session.delete(shoppingItemPrice);
733                            }
734                    }
735                    catch (Exception e) {
736                            throw processException(e);
737                    }
738                    finally {
739                            closeSession(session);
740                    }
741    
742                    if (shoppingItemPrice != null) {
743                            clearCache(shoppingItemPrice);
744                    }
745    
746                    return shoppingItemPrice;
747            }
748    
749            @Override
750            public ShoppingItemPrice updateImpl(ShoppingItemPrice shoppingItemPrice) {
751                    shoppingItemPrice = toUnwrappedModel(shoppingItemPrice);
752    
753                    boolean isNew = shoppingItemPrice.isNew();
754    
755                    ShoppingItemPriceModelImpl shoppingItemPriceModelImpl = (ShoppingItemPriceModelImpl)shoppingItemPrice;
756    
757                    Session session = null;
758    
759                    try {
760                            session = openSession();
761    
762                            if (shoppingItemPrice.isNew()) {
763                                    session.save(shoppingItemPrice);
764    
765                                    shoppingItemPrice.setNew(false);
766                            }
767                            else {
768                                    session.merge(shoppingItemPrice);
769                            }
770                    }
771                    catch (Exception e) {
772                            throw processException(e);
773                    }
774                    finally {
775                            closeSession(session);
776                    }
777    
778                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
779    
780                    if (isNew || !ShoppingItemPriceModelImpl.COLUMN_BITMASK_ENABLED) {
781                            FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
782                    }
783    
784                    else {
785                            if ((shoppingItemPriceModelImpl.getColumnBitmask() &
786                                            FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID.getColumnBitmask()) != 0) {
787                                    Object[] args = new Object[] {
788                                                    shoppingItemPriceModelImpl.getOriginalItemId()
789                                            };
790    
791                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ITEMID, args);
792                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID,
793                                            args);
794    
795                                    args = new Object[] { shoppingItemPriceModelImpl.getItemId() };
796    
797                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ITEMID, args);
798                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID,
799                                            args);
800                            }
801                    }
802    
803                    EntityCacheUtil.putResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
804                            ShoppingItemPriceImpl.class, shoppingItemPrice.getPrimaryKey(),
805                            shoppingItemPrice, false);
806    
807                    shoppingItemPrice.resetOriginalValues();
808    
809                    return shoppingItemPrice;
810            }
811    
812            protected ShoppingItemPrice toUnwrappedModel(
813                    ShoppingItemPrice shoppingItemPrice) {
814                    if (shoppingItemPrice instanceof ShoppingItemPriceImpl) {
815                            return shoppingItemPrice;
816                    }
817    
818                    ShoppingItemPriceImpl shoppingItemPriceImpl = new ShoppingItemPriceImpl();
819    
820                    shoppingItemPriceImpl.setNew(shoppingItemPrice.isNew());
821                    shoppingItemPriceImpl.setPrimaryKey(shoppingItemPrice.getPrimaryKey());
822    
823                    shoppingItemPriceImpl.setItemPriceId(shoppingItemPrice.getItemPriceId());
824                    shoppingItemPriceImpl.setItemId(shoppingItemPrice.getItemId());
825                    shoppingItemPriceImpl.setMinQuantity(shoppingItemPrice.getMinQuantity());
826                    shoppingItemPriceImpl.setMaxQuantity(shoppingItemPrice.getMaxQuantity());
827                    shoppingItemPriceImpl.setPrice(shoppingItemPrice.getPrice());
828                    shoppingItemPriceImpl.setDiscount(shoppingItemPrice.getDiscount());
829                    shoppingItemPriceImpl.setTaxable(shoppingItemPrice.isTaxable());
830                    shoppingItemPriceImpl.setShipping(shoppingItemPrice.getShipping());
831                    shoppingItemPriceImpl.setUseShippingFormula(shoppingItemPrice.isUseShippingFormula());
832                    shoppingItemPriceImpl.setStatus(shoppingItemPrice.getStatus());
833    
834                    return shoppingItemPriceImpl;
835            }
836    
837            /**
838             * Returns the shopping item price with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
839             *
840             * @param primaryKey the primary key of the shopping item price
841             * @return the shopping item price
842             * @throws NoSuchItemPriceException if a shopping item price with the primary key could not be found
843             */
844            @Override
845            public ShoppingItemPrice findByPrimaryKey(Serializable primaryKey)
846                    throws NoSuchItemPriceException {
847                    ShoppingItemPrice shoppingItemPrice = fetchByPrimaryKey(primaryKey);
848    
849                    if (shoppingItemPrice == null) {
850                            if (_log.isWarnEnabled()) {
851                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
852                            }
853    
854                            throw new NoSuchItemPriceException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
855                                    primaryKey);
856                    }
857    
858                    return shoppingItemPrice;
859            }
860    
861            /**
862             * Returns the shopping item price with the primary key or throws a {@link NoSuchItemPriceException} if it could not be found.
863             *
864             * @param itemPriceId the primary key of the shopping item price
865             * @return the shopping item price
866             * @throws NoSuchItemPriceException if a shopping item price with the primary key could not be found
867             */
868            @Override
869            public ShoppingItemPrice findByPrimaryKey(long itemPriceId)
870                    throws NoSuchItemPriceException {
871                    return findByPrimaryKey((Serializable)itemPriceId);
872            }
873    
874            /**
875             * Returns the shopping item price with the primary key or returns <code>null</code> if it could not be found.
876             *
877             * @param primaryKey the primary key of the shopping item price
878             * @return the shopping item price, or <code>null</code> if a shopping item price with the primary key could not be found
879             */
880            @Override
881            public ShoppingItemPrice fetchByPrimaryKey(Serializable primaryKey) {
882                    ShoppingItemPrice shoppingItemPrice = (ShoppingItemPrice)EntityCacheUtil.getResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
883                                    ShoppingItemPriceImpl.class, primaryKey);
884    
885                    if (shoppingItemPrice == _nullShoppingItemPrice) {
886                            return null;
887                    }
888    
889                    if (shoppingItemPrice == null) {
890                            Session session = null;
891    
892                            try {
893                                    session = openSession();
894    
895                                    shoppingItemPrice = (ShoppingItemPrice)session.get(ShoppingItemPriceImpl.class,
896                                                    primaryKey);
897    
898                                    if (shoppingItemPrice != null) {
899                                            cacheResult(shoppingItemPrice);
900                                    }
901                                    else {
902                                            EntityCacheUtil.putResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
903                                                    ShoppingItemPriceImpl.class, primaryKey,
904                                                    _nullShoppingItemPrice);
905                                    }
906                            }
907                            catch (Exception e) {
908                                    EntityCacheUtil.removeResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
909                                            ShoppingItemPriceImpl.class, primaryKey);
910    
911                                    throw processException(e);
912                            }
913                            finally {
914                                    closeSession(session);
915                            }
916                    }
917    
918                    return shoppingItemPrice;
919            }
920    
921            /**
922             * Returns the shopping item price with the primary key or returns <code>null</code> if it could not be found.
923             *
924             * @param itemPriceId the primary key of the shopping item price
925             * @return the shopping item price, or <code>null</code> if a shopping item price with the primary key could not be found
926             */
927            @Override
928            public ShoppingItemPrice fetchByPrimaryKey(long itemPriceId) {
929                    return fetchByPrimaryKey((Serializable)itemPriceId);
930            }
931    
932            @Override
933            public Map<Serializable, ShoppingItemPrice> fetchByPrimaryKeys(
934                    Set<Serializable> primaryKeys) {
935                    if (primaryKeys.isEmpty()) {
936                            return Collections.emptyMap();
937                    }
938    
939                    Map<Serializable, ShoppingItemPrice> map = new HashMap<Serializable, ShoppingItemPrice>();
940    
941                    if (primaryKeys.size() == 1) {
942                            Iterator<Serializable> iterator = primaryKeys.iterator();
943    
944                            Serializable primaryKey = iterator.next();
945    
946                            ShoppingItemPrice shoppingItemPrice = fetchByPrimaryKey(primaryKey);
947    
948                            if (shoppingItemPrice != null) {
949                                    map.put(primaryKey, shoppingItemPrice);
950                            }
951    
952                            return map;
953                    }
954    
955                    Set<Serializable> uncachedPrimaryKeys = null;
956    
957                    for (Serializable primaryKey : primaryKeys) {
958                            ShoppingItemPrice shoppingItemPrice = (ShoppingItemPrice)EntityCacheUtil.getResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
959                                            ShoppingItemPriceImpl.class, primaryKey);
960    
961                            if (shoppingItemPrice == null) {
962                                    if (uncachedPrimaryKeys == null) {
963                                            uncachedPrimaryKeys = new HashSet<Serializable>();
964                                    }
965    
966                                    uncachedPrimaryKeys.add(primaryKey);
967                            }
968                            else {
969                                    map.put(primaryKey, shoppingItemPrice);
970                            }
971                    }
972    
973                    if (uncachedPrimaryKeys == null) {
974                            return map;
975                    }
976    
977                    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) +
978                                    1);
979    
980                    query.append(_SQL_SELECT_SHOPPINGITEMPRICE_WHERE_PKS_IN);
981    
982                    for (Serializable primaryKey : uncachedPrimaryKeys) {
983                            query.append(String.valueOf(primaryKey));
984    
985                            query.append(StringPool.COMMA);
986                    }
987    
988                    query.setIndex(query.index() - 1);
989    
990                    query.append(StringPool.CLOSE_PARENTHESIS);
991    
992                    String sql = query.toString();
993    
994                    Session session = null;
995    
996                    try {
997                            session = openSession();
998    
999                            Query q = session.createQuery(sql);
1000    
1001                            for (ShoppingItemPrice shoppingItemPrice : (List<ShoppingItemPrice>)q.list()) {
1002                                    map.put(shoppingItemPrice.getPrimaryKeyObj(), shoppingItemPrice);
1003    
1004                                    cacheResult(shoppingItemPrice);
1005    
1006                                    uncachedPrimaryKeys.remove(shoppingItemPrice.getPrimaryKeyObj());
1007                            }
1008    
1009                            for (Serializable primaryKey : uncachedPrimaryKeys) {
1010                                    EntityCacheUtil.putResult(ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
1011                                            ShoppingItemPriceImpl.class, primaryKey,
1012                                            _nullShoppingItemPrice);
1013                            }
1014                    }
1015                    catch (Exception e) {
1016                            throw processException(e);
1017                    }
1018                    finally {
1019                            closeSession(session);
1020                    }
1021    
1022                    return map;
1023            }
1024    
1025            /**
1026             * Returns all the shopping item prices.
1027             *
1028             * @return the shopping item prices
1029             */
1030            @Override
1031            public List<ShoppingItemPrice> findAll() {
1032                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1033            }
1034    
1035            /**
1036             * Returns a range of all the shopping item prices.
1037             *
1038             * <p>
1039             * 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 ShoppingItemPriceModelImpl}. 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.
1040             * </p>
1041             *
1042             * @param start the lower bound of the range of shopping item prices
1043             * @param end the upper bound of the range of shopping item prices (not inclusive)
1044             * @return the range of shopping item prices
1045             */
1046            @Override
1047            public List<ShoppingItemPrice> findAll(int start, int end) {
1048                    return findAll(start, end, null);
1049            }
1050    
1051            /**
1052             * Returns an ordered range of all the shopping item prices.
1053             *
1054             * <p>
1055             * 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 ShoppingItemPriceModelImpl}. 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.
1056             * </p>
1057             *
1058             * @param start the lower bound of the range of shopping item prices
1059             * @param end the upper bound of the range of shopping item prices (not inclusive)
1060             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1061             * @return the ordered range of shopping item prices
1062             */
1063            @Override
1064            public List<ShoppingItemPrice> findAll(int start, int end,
1065                    OrderByComparator<ShoppingItemPrice> orderByComparator) {
1066                    boolean pagination = true;
1067                    FinderPath finderPath = null;
1068                    Object[] finderArgs = null;
1069    
1070                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1071                                    (orderByComparator == null)) {
1072                            pagination = false;
1073                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1074                            finderArgs = FINDER_ARGS_EMPTY;
1075                    }
1076                    else {
1077                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1078                            finderArgs = new Object[] { start, end, orderByComparator };
1079                    }
1080    
1081                    List<ShoppingItemPrice> list = (List<ShoppingItemPrice>)FinderCacheUtil.getResult(finderPath,
1082                                    finderArgs, this);
1083    
1084                    if (list == null) {
1085                            StringBundler query = null;
1086                            String sql = null;
1087    
1088                            if (orderByComparator != null) {
1089                                    query = new StringBundler(2 +
1090                                                    (orderByComparator.getOrderByFields().length * 3));
1091    
1092                                    query.append(_SQL_SELECT_SHOPPINGITEMPRICE);
1093    
1094                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1095                                            orderByComparator);
1096    
1097                                    sql = query.toString();
1098                            }
1099                            else {
1100                                    sql = _SQL_SELECT_SHOPPINGITEMPRICE;
1101    
1102                                    if (pagination) {
1103                                            sql = sql.concat(ShoppingItemPriceModelImpl.ORDER_BY_JPQL);
1104                                    }
1105                            }
1106    
1107                            Session session = null;
1108    
1109                            try {
1110                                    session = openSession();
1111    
1112                                    Query q = session.createQuery(sql);
1113    
1114                                    if (!pagination) {
1115                                            list = (List<ShoppingItemPrice>)QueryUtil.list(q,
1116                                                            getDialect(), start, end, false);
1117    
1118                                            Collections.sort(list);
1119    
1120                                            list = Collections.unmodifiableList(list);
1121                                    }
1122                                    else {
1123                                            list = (List<ShoppingItemPrice>)QueryUtil.list(q,
1124                                                            getDialect(), start, end);
1125                                    }
1126    
1127                                    cacheResult(list);
1128    
1129                                    FinderCacheUtil.putResult(finderPath, finderArgs, list);
1130                            }
1131                            catch (Exception e) {
1132                                    FinderCacheUtil.removeResult(finderPath, finderArgs);
1133    
1134                                    throw processException(e);
1135                            }
1136                            finally {
1137                                    closeSession(session);
1138                            }
1139                    }
1140    
1141                    return list;
1142            }
1143    
1144            /**
1145             * Removes all the shopping item prices from the database.
1146             *
1147             */
1148            @Override
1149            public void removeAll() {
1150                    for (ShoppingItemPrice shoppingItemPrice : findAll()) {
1151                            remove(shoppingItemPrice);
1152                    }
1153            }
1154    
1155            /**
1156             * Returns the number of shopping item prices.
1157             *
1158             * @return the number of shopping item prices
1159             */
1160            @Override
1161            public int countAll() {
1162                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1163                                    FINDER_ARGS_EMPTY, this);
1164    
1165                    if (count == null) {
1166                            Session session = null;
1167    
1168                            try {
1169                                    session = openSession();
1170    
1171                                    Query q = session.createQuery(_SQL_COUNT_SHOPPINGITEMPRICE);
1172    
1173                                    count = (Long)q.uniqueResult();
1174    
1175                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1176                                            FINDER_ARGS_EMPTY, count);
1177                            }
1178                            catch (Exception e) {
1179                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
1180                                            FINDER_ARGS_EMPTY);
1181    
1182                                    throw processException(e);
1183                            }
1184                            finally {
1185                                    closeSession(session);
1186                            }
1187                    }
1188    
1189                    return count.intValue();
1190            }
1191    
1192            /**
1193             * Initializes the shopping item price persistence.
1194             */
1195            public void afterPropertiesSet() {
1196            }
1197    
1198            public void destroy() {
1199                    EntityCacheUtil.removeCache(ShoppingItemPriceImpl.class.getName());
1200                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1201                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
1202                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1203            }
1204    
1205            private static final String _SQL_SELECT_SHOPPINGITEMPRICE = "SELECT shoppingItemPrice FROM ShoppingItemPrice shoppingItemPrice";
1206            private static final String _SQL_SELECT_SHOPPINGITEMPRICE_WHERE_PKS_IN = "SELECT shoppingItemPrice FROM ShoppingItemPrice shoppingItemPrice WHERE itemPriceId IN (";
1207            private static final String _SQL_SELECT_SHOPPINGITEMPRICE_WHERE = "SELECT shoppingItemPrice FROM ShoppingItemPrice shoppingItemPrice WHERE ";
1208            private static final String _SQL_COUNT_SHOPPINGITEMPRICE = "SELECT COUNT(shoppingItemPrice) FROM ShoppingItemPrice shoppingItemPrice";
1209            private static final String _SQL_COUNT_SHOPPINGITEMPRICE_WHERE = "SELECT COUNT(shoppingItemPrice) FROM ShoppingItemPrice shoppingItemPrice WHERE ";
1210            private static final String _ORDER_BY_ENTITY_ALIAS = "shoppingItemPrice.";
1211            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ShoppingItemPrice exists with the primary key ";
1212            private static final String _NO_SUCH_ENTITY_WITH_KEY = "No ShoppingItemPrice exists with the key {";
1213            private static final Log _log = LogFactoryUtil.getLog(ShoppingItemPricePersistenceImpl.class);
1214            private static final ShoppingItemPrice _nullShoppingItemPrice = new ShoppingItemPriceImpl() {
1215                            @Override
1216                            public Object clone() {
1217                                    return this;
1218                            }
1219    
1220                            @Override
1221                            public CacheModel<ShoppingItemPrice> toCacheModel() {
1222                                    return _nullShoppingItemPriceCacheModel;
1223                            }
1224                    };
1225    
1226            private static final CacheModel<ShoppingItemPrice> _nullShoppingItemPriceCacheModel =
1227                    new CacheModel<ShoppingItemPrice>() {
1228                            @Override
1229                            public ShoppingItemPrice toEntityModel() {
1230                                    return _nullShoppingItemPrice;
1231                            }
1232                    };
1233    }