All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.liferay.commerce.service.persistence.impl.CommerceShipmentPersistenceImpl Maven / Gradle / Ivy

The newest version!
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */

package com.liferay.commerce.service.persistence.impl;

import com.liferay.commerce.exception.DuplicateCommerceShipmentExternalReferenceCodeException;
import com.liferay.commerce.exception.NoSuchShipmentException;
import com.liferay.commerce.model.CommerceShipment;
import com.liferay.commerce.model.CommerceShipmentTable;
import com.liferay.commerce.model.impl.CommerceShipmentImpl;
import com.liferay.commerce.model.impl.CommerceShipmentModelImpl;
import com.liferay.commerce.service.persistence.CommerceShipmentPersistence;
import com.liferay.commerce.service.persistence.CommerceShipmentUtil;
import com.liferay.commerce.service.persistence.impl.constants.CommercePersistenceConstants;
import com.liferay.petra.string.StringBundler;
import com.liferay.portal.kernel.configuration.Configuration;
import com.liferay.portal.kernel.dao.orm.EntityCache;
import com.liferay.portal.kernel.dao.orm.FinderCache;
import com.liferay.portal.kernel.dao.orm.FinderPath;
import com.liferay.portal.kernel.dao.orm.Query;
import com.liferay.portal.kernel.dao.orm.QueryPos;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.dao.orm.SessionFactory;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.sanitizer.Sanitizer;
import com.liferay.portal.kernel.sanitizer.SanitizerException;
import com.liferay.portal.kernel.sanitizer.SanitizerUtil;
import com.liferay.portal.kernel.security.auth.CompanyThreadLocal;
import com.liferay.portal.kernel.security.auth.PrincipalThreadLocal;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.service.ServiceContextThreadLocal;
import com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl;
import com.liferay.portal.kernel.util.ArrayUtil;
import com.liferay.portal.kernel.util.ContentTypes;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.SetUtil;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.uuid.PortalUUIDUtil;

import java.io.Serializable;

import java.lang.reflect.InvocationHandler;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import javax.sql.DataSource;

import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;

/**
 * The persistence implementation for the commerce shipment service.
 *
 * 

* Caching information and settings can be found in portal.properties *

* * @author Alessio Antonio Rendina * @generated */ @Component(service = CommerceShipmentPersistence.class) public class CommerceShipmentPersistenceImpl extends BasePersistenceImpl implements CommerceShipmentPersistence { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this class directly. Always use CommerceShipmentUtil to access the commerce shipment persistence. Modify service.xml and rerun ServiceBuilder to regenerate this class. */ public static final String FINDER_CLASS_NAME_ENTITY = CommerceShipmentImpl.class.getName(); public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY + ".List1"; public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY + ".List2"; private FinderPath _finderPathWithPaginationFindAll; private FinderPath _finderPathWithoutPaginationFindAll; private FinderPath _finderPathCountAll; private FinderPath _finderPathWithPaginationFindByUuid; private FinderPath _finderPathWithoutPaginationFindByUuid; private FinderPath _finderPathCountByUuid; /** * Returns all the commerce shipments where uuid = ?. * * @param uuid the uuid * @return the matching commerce shipments */ @Override public List findByUuid(String uuid) { return findByUuid(uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments where uuid = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param uuid the uuid * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of matching commerce shipments */ @Override public List findByUuid(String uuid, int start, int end) { return findByUuid(uuid, start, end, null); } /** * Returns an ordered range of all the commerce shipments where uuid = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param uuid the uuid * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of matching commerce shipments */ @Override public List findByUuid( String uuid, int start, int end, OrderByComparator orderByComparator) { return findByUuid(uuid, start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments where uuid = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param uuid the uuid * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of matching commerce shipments */ @Override public List findByUuid( String uuid, int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { uuid = Objects.toString(uuid, ""); FinderPath finderPath = null; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderPath = _finderPathWithoutPaginationFindByUuid; finderArgs = new Object[] {uuid}; } } else if (useFinderCache) { finderPath = _finderPathWithPaginationFindByUuid; finderArgs = new Object[] {uuid, start, end, orderByComparator}; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (CommerceShipment commerceShipment : list) { if (!uuid.equals(commerceShipment.getUuid())) { list = null; break; } } } } if (list == null) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 3 + (orderByComparator.getOrderByFields().length * 2)); } else { sb = new StringBundler(3); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); boolean bindUuid = false; if (uuid.isEmpty()) { sb.append(_FINDER_COLUMN_UUID_UUID_3); } else { bindUuid = true; sb.append(_FINDER_COLUMN_UUID_UUID_2); } if (orderByComparator != null) { appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); if (bindUuid) { queryPos.add(uuid); } list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult(finderPath, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Returns the first commerce shipment in the ordered set where uuid = ?. * * @param uuid the uuid * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByUuid_First( String uuid, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByUuid_First( uuid, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(4); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("uuid="); sb.append(uuid); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the first commerce shipment in the ordered set where uuid = ?. * * @param uuid the uuid * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByUuid_First( String uuid, OrderByComparator orderByComparator) { List list = findByUuid(uuid, 0, 1, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the last commerce shipment in the ordered set where uuid = ?. * * @param uuid the uuid * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByUuid_Last( String uuid, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByUuid_Last( uuid, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(4); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("uuid="); sb.append(uuid); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the last commerce shipment in the ordered set where uuid = ?. * * @param uuid the uuid * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByUuid_Last( String uuid, OrderByComparator orderByComparator) { int count = countByUuid(uuid); if (count == 0) { return null; } List list = findByUuid( uuid, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the commerce shipments before and after the current commerce shipment in the ordered set where uuid = ?. * * @param commerceShipmentId the primary key of the current commerce shipment * @param uuid the uuid * @param orderByComparator the comparator to order the set by (optionally null) * @return the previous, current, and next commerce shipment * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment[] findByUuid_PrevAndNext( long commerceShipmentId, String uuid, OrderByComparator orderByComparator) throws NoSuchShipmentException { uuid = Objects.toString(uuid, ""); CommerceShipment commerceShipment = findByPrimaryKey( commerceShipmentId); Session session = null; try { session = openSession(); CommerceShipment[] array = new CommerceShipmentImpl[3]; array[0] = getByUuid_PrevAndNext( session, commerceShipment, uuid, orderByComparator, true); array[1] = commerceShipment; array[2] = getByUuid_PrevAndNext( session, commerceShipment, uuid, orderByComparator, false); return array; } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } protected CommerceShipment getByUuid_PrevAndNext( Session session, CommerceShipment commerceShipment, String uuid, OrderByComparator orderByComparator, boolean previous) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 4 + (orderByComparator.getOrderByConditionFields().length * 3) + (orderByComparator.getOrderByFields().length * 3)); } else { sb = new StringBundler(3); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); boolean bindUuid = false; if (uuid.isEmpty()) { sb.append(_FINDER_COLUMN_UUID_UUID_3); } else { bindUuid = true; sb.append(_FINDER_COLUMN_UUID_UUID_2); } if (orderByComparator != null) { String[] orderByConditionFields = orderByComparator.getOrderByConditionFields(); if (orderByConditionFields.length > 0) { sb.append(WHERE_AND); } for (int i = 0; i < orderByConditionFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByConditionFields[i]); if ((i + 1) < orderByConditionFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN_HAS_NEXT); } else { sb.append(WHERE_LESSER_THAN_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN); } else { sb.append(WHERE_LESSER_THAN); } } } sb.append(ORDER_BY_CLAUSE); String[] orderByFields = orderByComparator.getOrderByFields(); for (int i = 0; i < orderByFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByFields[i]); if ((i + 1) < orderByFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC_HAS_NEXT); } else { sb.append(ORDER_BY_DESC_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC); } else { sb.append(ORDER_BY_DESC); } } } } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Query query = session.createQuery(sql); query.setFirstResult(0); query.setMaxResults(2); QueryPos queryPos = QueryPos.getInstance(query); if (bindUuid) { queryPos.add(uuid); } if (orderByComparator != null) { for (Object orderByConditionValue : orderByComparator.getOrderByConditionValues( commerceShipment)) { queryPos.add(orderByConditionValue); } } List list = query.list(); if (list.size() == 2) { return list.get(1); } else { return null; } } /** * Removes all the commerce shipments where uuid = ? from the database. * * @param uuid the uuid */ @Override public void removeByUuid(String uuid) { for (CommerceShipment commerceShipment : findByUuid(uuid, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceShipment); } } /** * Returns the number of commerce shipments where uuid = ?. * * @param uuid the uuid * @return the number of matching commerce shipments */ @Override public int countByUuid(String uuid) { uuid = Objects.toString(uuid, ""); FinderPath finderPath = _finderPathCountByUuid; Object[] finderArgs = new Object[] {uuid}; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(2); sb.append(_SQL_COUNT_COMMERCESHIPMENT_WHERE); boolean bindUuid = false; if (uuid.isEmpty()) { sb.append(_FINDER_COLUMN_UUID_UUID_3); } else { bindUuid = true; sb.append(_FINDER_COLUMN_UUID_UUID_2); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); if (bindUuid) { queryPos.add(uuid); } count = (Long)query.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } private static final String _FINDER_COLUMN_UUID_UUID_2 = "commerceShipment.uuid = ?"; private static final String _FINDER_COLUMN_UUID_UUID_3 = "(commerceShipment.uuid IS NULL OR commerceShipment.uuid = '')"; private FinderPath _finderPathFetchByUUID_G; /** * Returns the commerce shipment where uuid = ? and groupId = ? or throws a NoSuchShipmentException if it could not be found. * * @param uuid the uuid * @param groupId the group ID * @return the matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByUUID_G(String uuid, long groupId) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByUUID_G(uuid, groupId); if (commerceShipment == null) { StringBundler sb = new StringBundler(6); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("uuid="); sb.append(uuid); sb.append(", groupId="); sb.append(groupId); sb.append("}"); if (_log.isDebugEnabled()) { _log.debug(sb.toString()); } throw new NoSuchShipmentException(sb.toString()); } return commerceShipment; } /** * Returns the commerce shipment where uuid = ? and groupId = ? or returns null if it could not be found. Uses the finder cache. * * @param uuid the uuid * @param groupId the group ID * @return the matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByUUID_G(String uuid, long groupId) { return fetchByUUID_G(uuid, groupId, true); } /** * Returns the commerce shipment where uuid = ? and groupId = ? or returns null if it could not be found, optionally using the finder cache. * * @param uuid the uuid * @param groupId the group ID * @param useFinderCache whether to use the finder cache * @return the matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByUUID_G( String uuid, long groupId, boolean useFinderCache) { uuid = Objects.toString(uuid, ""); Object[] finderArgs = null; if (useFinderCache) { finderArgs = new Object[] {uuid, groupId}; } Object result = null; if (useFinderCache) { result = finderCache.getResult( _finderPathFetchByUUID_G, finderArgs, this); } if (result instanceof CommerceShipment) { CommerceShipment commerceShipment = (CommerceShipment)result; if (!Objects.equals(uuid, commerceShipment.getUuid()) || (groupId != commerceShipment.getGroupId())) { result = null; } } if (result == null) { StringBundler sb = new StringBundler(4); sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); boolean bindUuid = false; if (uuid.isEmpty()) { sb.append(_FINDER_COLUMN_UUID_G_UUID_3); } else { bindUuid = true; sb.append(_FINDER_COLUMN_UUID_G_UUID_2); } sb.append(_FINDER_COLUMN_UUID_G_GROUPID_2); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); if (bindUuid) { queryPos.add(uuid); } queryPos.add(groupId); List list = query.list(); if (list.isEmpty()) { if (useFinderCache) { finderCache.putResult( _finderPathFetchByUUID_G, finderArgs, list); } } else { CommerceShipment commerceShipment = list.get(0); result = commerceShipment; cacheResult(commerceShipment); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } if (result instanceof List) { return null; } else { return (CommerceShipment)result; } } /** * Removes the commerce shipment where uuid = ? and groupId = ? from the database. * * @param uuid the uuid * @param groupId the group ID * @return the commerce shipment that was removed */ @Override public CommerceShipment removeByUUID_G(String uuid, long groupId) throws NoSuchShipmentException { CommerceShipment commerceShipment = findByUUID_G(uuid, groupId); return remove(commerceShipment); } /** * Returns the number of commerce shipments where uuid = ? and groupId = ?. * * @param uuid the uuid * @param groupId the group ID * @return the number of matching commerce shipments */ @Override public int countByUUID_G(String uuid, long groupId) { CommerceShipment commerceShipment = fetchByUUID_G(uuid, groupId); if (commerceShipment == null) { return 0; } return 1; } private static final String _FINDER_COLUMN_UUID_G_UUID_2 = "commerceShipment.uuid = ? AND "; private static final String _FINDER_COLUMN_UUID_G_UUID_3 = "(commerceShipment.uuid IS NULL OR commerceShipment.uuid = '') AND "; private static final String _FINDER_COLUMN_UUID_G_GROUPID_2 = "commerceShipment.groupId = ?"; private FinderPath _finderPathWithPaginationFindByUuid_C; private FinderPath _finderPathWithoutPaginationFindByUuid_C; private FinderPath _finderPathCountByUuid_C; /** * Returns all the commerce shipments where uuid = ? and companyId = ?. * * @param uuid the uuid * @param companyId the company ID * @return the matching commerce shipments */ @Override public List findByUuid_C(String uuid, long companyId) { return findByUuid_C( uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments where uuid = ? and companyId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param uuid the uuid * @param companyId the company ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of matching commerce shipments */ @Override public List findByUuid_C( String uuid, long companyId, int start, int end) { return findByUuid_C(uuid, companyId, start, end, null); } /** * Returns an ordered range of all the commerce shipments where uuid = ? and companyId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param uuid the uuid * @param companyId the company ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of matching commerce shipments */ @Override public List findByUuid_C( String uuid, long companyId, int start, int end, OrderByComparator orderByComparator) { return findByUuid_C( uuid, companyId, start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments where uuid = ? and companyId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param uuid the uuid * @param companyId the company ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of matching commerce shipments */ @Override public List findByUuid_C( String uuid, long companyId, int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { uuid = Objects.toString(uuid, ""); FinderPath finderPath = null; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderPath = _finderPathWithoutPaginationFindByUuid_C; finderArgs = new Object[] {uuid, companyId}; } } else if (useFinderCache) { finderPath = _finderPathWithPaginationFindByUuid_C; finderArgs = new Object[] { uuid, companyId, start, end, orderByComparator }; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (CommerceShipment commerceShipment : list) { if (!uuid.equals(commerceShipment.getUuid()) || (companyId != commerceShipment.getCompanyId())) { list = null; break; } } } } if (list == null) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 4 + (orderByComparator.getOrderByFields().length * 2)); } else { sb = new StringBundler(4); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); boolean bindUuid = false; if (uuid.isEmpty()) { sb.append(_FINDER_COLUMN_UUID_C_UUID_3); } else { bindUuid = true; sb.append(_FINDER_COLUMN_UUID_C_UUID_2); } sb.append(_FINDER_COLUMN_UUID_C_COMPANYID_2); if (orderByComparator != null) { appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); if (bindUuid) { queryPos.add(uuid); } queryPos.add(companyId); list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult(finderPath, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Returns the first commerce shipment in the ordered set where uuid = ? and companyId = ?. * * @param uuid the uuid * @param companyId the company ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByUuid_C_First( String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByUuid_C_First( uuid, companyId, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(6); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("uuid="); sb.append(uuid); sb.append(", companyId="); sb.append(companyId); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the first commerce shipment in the ordered set where uuid = ? and companyId = ?. * * @param uuid the uuid * @param companyId the company ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByUuid_C_First( String uuid, long companyId, OrderByComparator orderByComparator) { List list = findByUuid_C( uuid, companyId, 0, 1, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the last commerce shipment in the ordered set where uuid = ? and companyId = ?. * * @param uuid the uuid * @param companyId the company ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByUuid_C_Last( String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByUuid_C_Last( uuid, companyId, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(6); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("uuid="); sb.append(uuid); sb.append(", companyId="); sb.append(companyId); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the last commerce shipment in the ordered set where uuid = ? and companyId = ?. * * @param uuid the uuid * @param companyId the company ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByUuid_C_Last( String uuid, long companyId, OrderByComparator orderByComparator) { int count = countByUuid_C(uuid, companyId); if (count == 0) { return null; } List list = findByUuid_C( uuid, companyId, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the commerce shipments before and after the current commerce shipment in the ordered set where uuid = ? and companyId = ?. * * @param commerceShipmentId the primary key of the current commerce shipment * @param uuid the uuid * @param companyId the company ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the previous, current, and next commerce shipment * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment[] findByUuid_C_PrevAndNext( long commerceShipmentId, String uuid, long companyId, OrderByComparator orderByComparator) throws NoSuchShipmentException { uuid = Objects.toString(uuid, ""); CommerceShipment commerceShipment = findByPrimaryKey( commerceShipmentId); Session session = null; try { session = openSession(); CommerceShipment[] array = new CommerceShipmentImpl[3]; array[0] = getByUuid_C_PrevAndNext( session, commerceShipment, uuid, companyId, orderByComparator, true); array[1] = commerceShipment; array[2] = getByUuid_C_PrevAndNext( session, commerceShipment, uuid, companyId, orderByComparator, false); return array; } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } protected CommerceShipment getByUuid_C_PrevAndNext( Session session, CommerceShipment commerceShipment, String uuid, long companyId, OrderByComparator orderByComparator, boolean previous) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 5 + (orderByComparator.getOrderByConditionFields().length * 3) + (orderByComparator.getOrderByFields().length * 3)); } else { sb = new StringBundler(4); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); boolean bindUuid = false; if (uuid.isEmpty()) { sb.append(_FINDER_COLUMN_UUID_C_UUID_3); } else { bindUuid = true; sb.append(_FINDER_COLUMN_UUID_C_UUID_2); } sb.append(_FINDER_COLUMN_UUID_C_COMPANYID_2); if (orderByComparator != null) { String[] orderByConditionFields = orderByComparator.getOrderByConditionFields(); if (orderByConditionFields.length > 0) { sb.append(WHERE_AND); } for (int i = 0; i < orderByConditionFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByConditionFields[i]); if ((i + 1) < orderByConditionFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN_HAS_NEXT); } else { sb.append(WHERE_LESSER_THAN_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN); } else { sb.append(WHERE_LESSER_THAN); } } } sb.append(ORDER_BY_CLAUSE); String[] orderByFields = orderByComparator.getOrderByFields(); for (int i = 0; i < orderByFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByFields[i]); if ((i + 1) < orderByFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC_HAS_NEXT); } else { sb.append(ORDER_BY_DESC_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC); } else { sb.append(ORDER_BY_DESC); } } } } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Query query = session.createQuery(sql); query.setFirstResult(0); query.setMaxResults(2); QueryPos queryPos = QueryPos.getInstance(query); if (bindUuid) { queryPos.add(uuid); } queryPos.add(companyId); if (orderByComparator != null) { for (Object orderByConditionValue : orderByComparator.getOrderByConditionValues( commerceShipment)) { queryPos.add(orderByConditionValue); } } List list = query.list(); if (list.size() == 2) { return list.get(1); } else { return null; } } /** * Removes all the commerce shipments where uuid = ? and companyId = ? from the database. * * @param uuid the uuid * @param companyId the company ID */ @Override public void removeByUuid_C(String uuid, long companyId) { for (CommerceShipment commerceShipment : findByUuid_C( uuid, companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceShipment); } } /** * Returns the number of commerce shipments where uuid = ? and companyId = ?. * * @param uuid the uuid * @param companyId the company ID * @return the number of matching commerce shipments */ @Override public int countByUuid_C(String uuid, long companyId) { uuid = Objects.toString(uuid, ""); FinderPath finderPath = _finderPathCountByUuid_C; Object[] finderArgs = new Object[] {uuid, companyId}; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(3); sb.append(_SQL_COUNT_COMMERCESHIPMENT_WHERE); boolean bindUuid = false; if (uuid.isEmpty()) { sb.append(_FINDER_COLUMN_UUID_C_UUID_3); } else { bindUuid = true; sb.append(_FINDER_COLUMN_UUID_C_UUID_2); } sb.append(_FINDER_COLUMN_UUID_C_COMPANYID_2); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); if (bindUuid) { queryPos.add(uuid); } queryPos.add(companyId); count = (Long)query.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } private static final String _FINDER_COLUMN_UUID_C_UUID_2 = "commerceShipment.uuid = ? AND "; private static final String _FINDER_COLUMN_UUID_C_UUID_3 = "(commerceShipment.uuid IS NULL OR commerceShipment.uuid = '') AND "; private static final String _FINDER_COLUMN_UUID_C_COMPANYID_2 = "commerceShipment.companyId = ?"; private FinderPath _finderPathWithPaginationFindByGroupId; private FinderPath _finderPathWithoutPaginationFindByGroupId; private FinderPath _finderPathCountByGroupId; private FinderPath _finderPathWithPaginationCountByGroupId; /** * Returns all the commerce shipments where groupId = ?. * * @param groupId the group ID * @return the matching commerce shipments */ @Override public List findByGroupId(long groupId) { return findByGroupId( groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments where groupId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of matching commerce shipments */ @Override public List findByGroupId( long groupId, int start, int end) { return findByGroupId(groupId, start, end, null); } /** * Returns an ordered range of all the commerce shipments where groupId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of matching commerce shipments */ @Override public List findByGroupId( long groupId, int start, int end, OrderByComparator orderByComparator) { return findByGroupId(groupId, start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments where groupId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of matching commerce shipments */ @Override public List findByGroupId( long groupId, int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { FinderPath finderPath = null; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderPath = _finderPathWithoutPaginationFindByGroupId; finderArgs = new Object[] {groupId}; } } else if (useFinderCache) { finderPath = _finderPathWithPaginationFindByGroupId; finderArgs = new Object[] {groupId, start, end, orderByComparator}; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (CommerceShipment commerceShipment : list) { if (groupId != commerceShipment.getGroupId()) { list = null; break; } } } } if (list == null) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 3 + (orderByComparator.getOrderByFields().length * 2)); } else { sb = new StringBundler(3); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_GROUPID_GROUPID_2); if (orderByComparator != null) { appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult(finderPath, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Returns the first commerce shipment in the ordered set where groupId = ?. * * @param groupId the group ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByGroupId_First( long groupId, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByGroupId_First( groupId, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(4); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("groupId="); sb.append(groupId); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the first commerce shipment in the ordered set where groupId = ?. * * @param groupId the group ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByGroupId_First( long groupId, OrderByComparator orderByComparator) { List list = findByGroupId( groupId, 0, 1, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the last commerce shipment in the ordered set where groupId = ?. * * @param groupId the group ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByGroupId_Last( long groupId, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByGroupId_Last( groupId, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(4); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("groupId="); sb.append(groupId); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the last commerce shipment in the ordered set where groupId = ?. * * @param groupId the group ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByGroupId_Last( long groupId, OrderByComparator orderByComparator) { int count = countByGroupId(groupId); if (count == 0) { return null; } List list = findByGroupId( groupId, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the commerce shipments before and after the current commerce shipment in the ordered set where groupId = ?. * * @param commerceShipmentId the primary key of the current commerce shipment * @param groupId the group ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the previous, current, and next commerce shipment * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment[] findByGroupId_PrevAndNext( long commerceShipmentId, long groupId, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = findByPrimaryKey( commerceShipmentId); Session session = null; try { session = openSession(); CommerceShipment[] array = new CommerceShipmentImpl[3]; array[0] = getByGroupId_PrevAndNext( session, commerceShipment, groupId, orderByComparator, true); array[1] = commerceShipment; array[2] = getByGroupId_PrevAndNext( session, commerceShipment, groupId, orderByComparator, false); return array; } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } protected CommerceShipment getByGroupId_PrevAndNext( Session session, CommerceShipment commerceShipment, long groupId, OrderByComparator orderByComparator, boolean previous) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 4 + (orderByComparator.getOrderByConditionFields().length * 3) + (orderByComparator.getOrderByFields().length * 3)); } else { sb = new StringBundler(3); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_GROUPID_GROUPID_2); if (orderByComparator != null) { String[] orderByConditionFields = orderByComparator.getOrderByConditionFields(); if (orderByConditionFields.length > 0) { sb.append(WHERE_AND); } for (int i = 0; i < orderByConditionFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByConditionFields[i]); if ((i + 1) < orderByConditionFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN_HAS_NEXT); } else { sb.append(WHERE_LESSER_THAN_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN); } else { sb.append(WHERE_LESSER_THAN); } } } sb.append(ORDER_BY_CLAUSE); String[] orderByFields = orderByComparator.getOrderByFields(); for (int i = 0; i < orderByFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByFields[i]); if ((i + 1) < orderByFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC_HAS_NEXT); } else { sb.append(ORDER_BY_DESC_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC); } else { sb.append(ORDER_BY_DESC); } } } } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Query query = session.createQuery(sql); query.setFirstResult(0); query.setMaxResults(2); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); if (orderByComparator != null) { for (Object orderByConditionValue : orderByComparator.getOrderByConditionValues( commerceShipment)) { queryPos.add(orderByConditionValue); } } List list = query.list(); if (list.size() == 2) { return list.get(1); } else { return null; } } /** * Returns all the commerce shipments where groupId = any ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @return the matching commerce shipments */ @Override public List findByGroupId(long[] groupIds) { return findByGroupId( groupIds, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments where groupId = any ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of matching commerce shipments */ @Override public List findByGroupId( long[] groupIds, int start, int end) { return findByGroupId(groupIds, start, end, null); } /** * Returns an ordered range of all the commerce shipments where groupId = any ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of matching commerce shipments */ @Override public List findByGroupId( long[] groupIds, int start, int end, OrderByComparator orderByComparator) { return findByGroupId(groupIds, start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments where groupId = ?, optionally using the finder cache. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of matching commerce shipments */ @Override public List findByGroupId( long[] groupIds, int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { if (groupIds == null) { groupIds = new long[0]; } else if (groupIds.length > 1) { groupIds = ArrayUtil.sortedUnique(groupIds); } if (groupIds.length == 1) { return findByGroupId(groupIds[0], start, end, orderByComparator); } Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderArgs = new Object[] {StringUtil.merge(groupIds)}; } } else if (useFinderCache) { finderArgs = new Object[] { StringUtil.merge(groupIds), start, end, orderByComparator }; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( _finderPathWithPaginationFindByGroupId, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (CommerceShipment commerceShipment : list) { if (!ArrayUtil.contains( groupIds, commerceShipment.getGroupId())) { list = null; break; } } } } if (list == null) { StringBundler sb = new StringBundler(); sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); if (groupIds.length > 0) { sb.append("("); sb.append(_FINDER_COLUMN_GROUPID_GROUPID_7); sb.append(StringUtil.merge(groupIds)); sb.append(")"); sb.append(")"); } sb.setStringAt( removeConjunction(sb.stringAt(sb.index() - 1)), sb.index() - 1); if (orderByComparator != null) { appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult( _finderPathWithPaginationFindByGroupId, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Removes all the commerce shipments where groupId = ? from the database. * * @param groupId the group ID */ @Override public void removeByGroupId(long groupId) { for (CommerceShipment commerceShipment : findByGroupId( groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceShipment); } } /** * Returns the number of commerce shipments where groupId = ?. * * @param groupId the group ID * @return the number of matching commerce shipments */ @Override public int countByGroupId(long groupId) { FinderPath finderPath = _finderPathCountByGroupId; Object[] finderArgs = new Object[] {groupId}; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(2); sb.append(_SQL_COUNT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_GROUPID_GROUPID_2); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); count = (Long)query.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } /** * Returns the number of commerce shipments where groupId = any ?. * * @param groupIds the group IDs * @return the number of matching commerce shipments */ @Override public int countByGroupId(long[] groupIds) { if (groupIds == null) { groupIds = new long[0]; } else if (groupIds.length > 1) { groupIds = ArrayUtil.sortedUnique(groupIds); } Object[] finderArgs = new Object[] {StringUtil.merge(groupIds)}; Long count = (Long)finderCache.getResult( _finderPathWithPaginationCountByGroupId, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(); sb.append(_SQL_COUNT_COMMERCESHIPMENT_WHERE); if (groupIds.length > 0) { sb.append("("); sb.append(_FINDER_COLUMN_GROUPID_GROUPID_7); sb.append(StringUtil.merge(groupIds)); sb.append(")"); sb.append(")"); } sb.setStringAt( removeConjunction(sb.stringAt(sb.index() - 1)), sb.index() - 1); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); count = (Long)query.uniqueResult(); finderCache.putResult( _finderPathWithPaginationCountByGroupId, finderArgs, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "commerceShipment.groupId = ?"; private static final String _FINDER_COLUMN_GROUPID_GROUPID_7 = "commerceShipment.groupId IN ("; private FinderPath _finderPathWithPaginationFindByG_C; private FinderPath _finderPathWithoutPaginationFindByG_C; private FinderPath _finderPathCountByG_C; private FinderPath _finderPathWithPaginationCountByG_C; /** * Returns all the commerce shipments where groupId = ? and commerceAddressId = ?. * * @param groupId the group ID * @param commerceAddressId the commerce address ID * @return the matching commerce shipments */ @Override public List findByG_C( long groupId, long commerceAddressId) { return findByG_C( groupId, commerceAddressId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments where groupId = ? and commerceAddressId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param commerceAddressId the commerce address ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of matching commerce shipments */ @Override public List findByG_C( long groupId, long commerceAddressId, int start, int end) { return findByG_C(groupId, commerceAddressId, start, end, null); } /** * Returns an ordered range of all the commerce shipments where groupId = ? and commerceAddressId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param commerceAddressId the commerce address ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of matching commerce shipments */ @Override public List findByG_C( long groupId, long commerceAddressId, int start, int end, OrderByComparator orderByComparator) { return findByG_C( groupId, commerceAddressId, start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments where groupId = ? and commerceAddressId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param commerceAddressId the commerce address ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of matching commerce shipments */ @Override public List findByG_C( long groupId, long commerceAddressId, int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { FinderPath finderPath = null; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderPath = _finderPathWithoutPaginationFindByG_C; finderArgs = new Object[] {groupId, commerceAddressId}; } } else if (useFinderCache) { finderPath = _finderPathWithPaginationFindByG_C; finderArgs = new Object[] { groupId, commerceAddressId, start, end, orderByComparator }; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (CommerceShipment commerceShipment : list) { if ((groupId != commerceShipment.getGroupId()) || (commerceAddressId != commerceShipment.getCommerceAddressId())) { list = null; break; } } } } if (list == null) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 4 + (orderByComparator.getOrderByFields().length * 2)); } else { sb = new StringBundler(4); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_G_C_GROUPID_2); sb.append(_FINDER_COLUMN_G_C_COMMERCEADDRESSID_2); if (orderByComparator != null) { appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); queryPos.add(commerceAddressId); list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult(finderPath, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Returns the first commerce shipment in the ordered set where groupId = ? and commerceAddressId = ?. * * @param groupId the group ID * @param commerceAddressId the commerce address ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByG_C_First( long groupId, long commerceAddressId, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByG_C_First( groupId, commerceAddressId, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(6); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("groupId="); sb.append(groupId); sb.append(", commerceAddressId="); sb.append(commerceAddressId); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the first commerce shipment in the ordered set where groupId = ? and commerceAddressId = ?. * * @param groupId the group ID * @param commerceAddressId the commerce address ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByG_C_First( long groupId, long commerceAddressId, OrderByComparator orderByComparator) { List list = findByG_C( groupId, commerceAddressId, 0, 1, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the last commerce shipment in the ordered set where groupId = ? and commerceAddressId = ?. * * @param groupId the group ID * @param commerceAddressId the commerce address ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByG_C_Last( long groupId, long commerceAddressId, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByG_C_Last( groupId, commerceAddressId, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(6); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("groupId="); sb.append(groupId); sb.append(", commerceAddressId="); sb.append(commerceAddressId); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the last commerce shipment in the ordered set where groupId = ? and commerceAddressId = ?. * * @param groupId the group ID * @param commerceAddressId the commerce address ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByG_C_Last( long groupId, long commerceAddressId, OrderByComparator orderByComparator) { int count = countByG_C(groupId, commerceAddressId); if (count == 0) { return null; } List list = findByG_C( groupId, commerceAddressId, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the commerce shipments before and after the current commerce shipment in the ordered set where groupId = ? and commerceAddressId = ?. * * @param commerceShipmentId the primary key of the current commerce shipment * @param groupId the group ID * @param commerceAddressId the commerce address ID * @param orderByComparator the comparator to order the set by (optionally null) * @return the previous, current, and next commerce shipment * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment[] findByG_C_PrevAndNext( long commerceShipmentId, long groupId, long commerceAddressId, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = findByPrimaryKey( commerceShipmentId); Session session = null; try { session = openSession(); CommerceShipment[] array = new CommerceShipmentImpl[3]; array[0] = getByG_C_PrevAndNext( session, commerceShipment, groupId, commerceAddressId, orderByComparator, true); array[1] = commerceShipment; array[2] = getByG_C_PrevAndNext( session, commerceShipment, groupId, commerceAddressId, orderByComparator, false); return array; } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } protected CommerceShipment getByG_C_PrevAndNext( Session session, CommerceShipment commerceShipment, long groupId, long commerceAddressId, OrderByComparator orderByComparator, boolean previous) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 5 + (orderByComparator.getOrderByConditionFields().length * 3) + (orderByComparator.getOrderByFields().length * 3)); } else { sb = new StringBundler(4); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_G_C_GROUPID_2); sb.append(_FINDER_COLUMN_G_C_COMMERCEADDRESSID_2); if (orderByComparator != null) { String[] orderByConditionFields = orderByComparator.getOrderByConditionFields(); if (orderByConditionFields.length > 0) { sb.append(WHERE_AND); } for (int i = 0; i < orderByConditionFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByConditionFields[i]); if ((i + 1) < orderByConditionFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN_HAS_NEXT); } else { sb.append(WHERE_LESSER_THAN_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN); } else { sb.append(WHERE_LESSER_THAN); } } } sb.append(ORDER_BY_CLAUSE); String[] orderByFields = orderByComparator.getOrderByFields(); for (int i = 0; i < orderByFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByFields[i]); if ((i + 1) < orderByFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC_HAS_NEXT); } else { sb.append(ORDER_BY_DESC_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC); } else { sb.append(ORDER_BY_DESC); } } } } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Query query = session.createQuery(sql); query.setFirstResult(0); query.setMaxResults(2); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); queryPos.add(commerceAddressId); if (orderByComparator != null) { for (Object orderByConditionValue : orderByComparator.getOrderByConditionValues( commerceShipment)) { queryPos.add(orderByConditionValue); } } List list = query.list(); if (list.size() == 2) { return list.get(1); } else { return null; } } /** * Returns all the commerce shipments where groupId = any ? and commerceAddressId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param commerceAddressId the commerce address ID * @return the matching commerce shipments */ @Override public List findByG_C( long[] groupIds, long commerceAddressId) { return findByG_C( groupIds, commerceAddressId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments where groupId = any ? and commerceAddressId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param commerceAddressId the commerce address ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of matching commerce shipments */ @Override public List findByG_C( long[] groupIds, long commerceAddressId, int start, int end) { return findByG_C(groupIds, commerceAddressId, start, end, null); } /** * Returns an ordered range of all the commerce shipments where groupId = any ? and commerceAddressId = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param commerceAddressId the commerce address ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of matching commerce shipments */ @Override public List findByG_C( long[] groupIds, long commerceAddressId, int start, int end, OrderByComparator orderByComparator) { return findByG_C( groupIds, commerceAddressId, start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments where groupId = ? and commerceAddressId = ?, optionally using the finder cache. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param commerceAddressId the commerce address ID * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of matching commerce shipments */ @Override public List findByG_C( long[] groupIds, long commerceAddressId, int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { if (groupIds == null) { groupIds = new long[0]; } else if (groupIds.length > 1) { groupIds = ArrayUtil.sortedUnique(groupIds); } if (groupIds.length == 1) { return findByG_C( groupIds[0], commerceAddressId, start, end, orderByComparator); } Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderArgs = new Object[] { StringUtil.merge(groupIds), commerceAddressId }; } } else if (useFinderCache) { finderArgs = new Object[] { StringUtil.merge(groupIds), commerceAddressId, start, end, orderByComparator }; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( _finderPathWithPaginationFindByG_C, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (CommerceShipment commerceShipment : list) { if (!ArrayUtil.contains( groupIds, commerceShipment.getGroupId()) || (commerceAddressId != commerceShipment.getCommerceAddressId())) { list = null; break; } } } } if (list == null) { StringBundler sb = new StringBundler(); sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); if (groupIds.length > 0) { sb.append("("); sb.append(_FINDER_COLUMN_G_C_GROUPID_7); sb.append(StringUtil.merge(groupIds)); sb.append(")"); sb.append(")"); sb.append(WHERE_AND); } sb.append(_FINDER_COLUMN_G_C_COMMERCEADDRESSID_2); sb.setStringAt( removeConjunction(sb.stringAt(sb.index() - 1)), sb.index() - 1); if (orderByComparator != null) { appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(commerceAddressId); list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult( _finderPathWithPaginationFindByG_C, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Removes all the commerce shipments where groupId = ? and commerceAddressId = ? from the database. * * @param groupId the group ID * @param commerceAddressId the commerce address ID */ @Override public void removeByG_C(long groupId, long commerceAddressId) { for (CommerceShipment commerceShipment : findByG_C( groupId, commerceAddressId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceShipment); } } /** * Returns the number of commerce shipments where groupId = ? and commerceAddressId = ?. * * @param groupId the group ID * @param commerceAddressId the commerce address ID * @return the number of matching commerce shipments */ @Override public int countByG_C(long groupId, long commerceAddressId) { FinderPath finderPath = _finderPathCountByG_C; Object[] finderArgs = new Object[] {groupId, commerceAddressId}; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(3); sb.append(_SQL_COUNT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_G_C_GROUPID_2); sb.append(_FINDER_COLUMN_G_C_COMMERCEADDRESSID_2); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); queryPos.add(commerceAddressId); count = (Long)query.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } /** * Returns the number of commerce shipments where groupId = any ? and commerceAddressId = ?. * * @param groupIds the group IDs * @param commerceAddressId the commerce address ID * @return the number of matching commerce shipments */ @Override public int countByG_C(long[] groupIds, long commerceAddressId) { if (groupIds == null) { groupIds = new long[0]; } else if (groupIds.length > 1) { groupIds = ArrayUtil.sortedUnique(groupIds); } Object[] finderArgs = new Object[] { StringUtil.merge(groupIds), commerceAddressId }; Long count = (Long)finderCache.getResult( _finderPathWithPaginationCountByG_C, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(); sb.append(_SQL_COUNT_COMMERCESHIPMENT_WHERE); if (groupIds.length > 0) { sb.append("("); sb.append(_FINDER_COLUMN_G_C_GROUPID_7); sb.append(StringUtil.merge(groupIds)); sb.append(")"); sb.append(")"); sb.append(WHERE_AND); } sb.append(_FINDER_COLUMN_G_C_COMMERCEADDRESSID_2); sb.setStringAt( removeConjunction(sb.stringAt(sb.index() - 1)), sb.index() - 1); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(commerceAddressId); count = (Long)query.uniqueResult(); finderCache.putResult( _finderPathWithPaginationCountByG_C, finderArgs, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } private static final String _FINDER_COLUMN_G_C_GROUPID_2 = "commerceShipment.groupId = ? AND "; private static final String _FINDER_COLUMN_G_C_GROUPID_7 = "commerceShipment.groupId IN ("; private static final String _FINDER_COLUMN_G_C_COMMERCEADDRESSID_2 = "commerceShipment.commerceAddressId = ?"; private FinderPath _finderPathWithPaginationFindByG_S; private FinderPath _finderPathWithoutPaginationFindByG_S; private FinderPath _finderPathCountByG_S; private FinderPath _finderPathWithPaginationCountByG_S; /** * Returns all the commerce shipments where groupId = ? and status = ?. * * @param groupId the group ID * @param status the status * @return the matching commerce shipments */ @Override public List findByG_S(long groupId, int status) { return findByG_S( groupId, status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments where groupId = ? and status = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param status the status * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of matching commerce shipments */ @Override public List findByG_S( long groupId, int status, int start, int end) { return findByG_S(groupId, status, start, end, null); } /** * Returns an ordered range of all the commerce shipments where groupId = ? and status = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param status the status * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of matching commerce shipments */ @Override public List findByG_S( long groupId, int status, int start, int end, OrderByComparator orderByComparator) { return findByG_S(groupId, status, start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments where groupId = ? and status = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupId the group ID * @param status the status * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of matching commerce shipments */ @Override public List findByG_S( long groupId, int status, int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { FinderPath finderPath = null; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderPath = _finderPathWithoutPaginationFindByG_S; finderArgs = new Object[] {groupId, status}; } } else if (useFinderCache) { finderPath = _finderPathWithPaginationFindByG_S; finderArgs = new Object[] { groupId, status, start, end, orderByComparator }; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( finderPath, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (CommerceShipment commerceShipment : list) { if ((groupId != commerceShipment.getGroupId()) || (status != commerceShipment.getStatus())) { list = null; break; } } } } if (list == null) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 4 + (orderByComparator.getOrderByFields().length * 2)); } else { sb = new StringBundler(4); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_G_S_GROUPID_2); sb.append(_FINDER_COLUMN_G_S_STATUS_2); if (orderByComparator != null) { appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); queryPos.add(status); list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult(finderPath, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Returns the first commerce shipment in the ordered set where groupId = ? and status = ?. * * @param groupId the group ID * @param status the status * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByG_S_First( long groupId, int status, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByG_S_First( groupId, status, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(6); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("groupId="); sb.append(groupId); sb.append(", status="); sb.append(status); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the first commerce shipment in the ordered set where groupId = ? and status = ?. * * @param groupId the group ID * @param status the status * @param orderByComparator the comparator to order the set by (optionally null) * @return the first matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByG_S_First( long groupId, int status, OrderByComparator orderByComparator) { List list = findByG_S( groupId, status, 0, 1, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the last commerce shipment in the ordered set where groupId = ? and status = ?. * * @param groupId the group ID * @param status the status * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByG_S_Last( long groupId, int status, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByG_S_Last( groupId, status, orderByComparator); if (commerceShipment != null) { return commerceShipment; } StringBundler sb = new StringBundler(6); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("groupId="); sb.append(groupId); sb.append(", status="); sb.append(status); sb.append("}"); throw new NoSuchShipmentException(sb.toString()); } /** * Returns the last commerce shipment in the ordered set where groupId = ? and status = ?. * * @param groupId the group ID * @param status the status * @param orderByComparator the comparator to order the set by (optionally null) * @return the last matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByG_S_Last( long groupId, int status, OrderByComparator orderByComparator) { int count = countByG_S(groupId, status); if (count == 0) { return null; } List list = findByG_S( groupId, status, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; } /** * Returns the commerce shipments before and after the current commerce shipment in the ordered set where groupId = ? and status = ?. * * @param commerceShipmentId the primary key of the current commerce shipment * @param groupId the group ID * @param status the status * @param orderByComparator the comparator to order the set by (optionally null) * @return the previous, current, and next commerce shipment * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment[] findByG_S_PrevAndNext( long commerceShipmentId, long groupId, int status, OrderByComparator orderByComparator) throws NoSuchShipmentException { CommerceShipment commerceShipment = findByPrimaryKey( commerceShipmentId); Session session = null; try { session = openSession(); CommerceShipment[] array = new CommerceShipmentImpl[3]; array[0] = getByG_S_PrevAndNext( session, commerceShipment, groupId, status, orderByComparator, true); array[1] = commerceShipment; array[2] = getByG_S_PrevAndNext( session, commerceShipment, groupId, status, orderByComparator, false); return array; } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } protected CommerceShipment getByG_S_PrevAndNext( Session session, CommerceShipment commerceShipment, long groupId, int status, OrderByComparator orderByComparator, boolean previous) { StringBundler sb = null; if (orderByComparator != null) { sb = new StringBundler( 5 + (orderByComparator.getOrderByConditionFields().length * 3) + (orderByComparator.getOrderByFields().length * 3)); } else { sb = new StringBundler(4); } sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_G_S_GROUPID_2); sb.append(_FINDER_COLUMN_G_S_STATUS_2); if (orderByComparator != null) { String[] orderByConditionFields = orderByComparator.getOrderByConditionFields(); if (orderByConditionFields.length > 0) { sb.append(WHERE_AND); } for (int i = 0; i < orderByConditionFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByConditionFields[i]); if ((i + 1) < orderByConditionFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN_HAS_NEXT); } else { sb.append(WHERE_LESSER_THAN_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(WHERE_GREATER_THAN); } else { sb.append(WHERE_LESSER_THAN); } } } sb.append(ORDER_BY_CLAUSE); String[] orderByFields = orderByComparator.getOrderByFields(); for (int i = 0; i < orderByFields.length; i++) { sb.append(_ORDER_BY_ENTITY_ALIAS); sb.append(orderByFields[i]); if ((i + 1) < orderByFields.length) { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC_HAS_NEXT); } else { sb.append(ORDER_BY_DESC_HAS_NEXT); } } else { if (orderByComparator.isAscending() ^ previous) { sb.append(ORDER_BY_ASC); } else { sb.append(ORDER_BY_DESC); } } } } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Query query = session.createQuery(sql); query.setFirstResult(0); query.setMaxResults(2); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); queryPos.add(status); if (orderByComparator != null) { for (Object orderByConditionValue : orderByComparator.getOrderByConditionValues( commerceShipment)) { queryPos.add(orderByConditionValue); } } List list = query.list(); if (list.size() == 2) { return list.get(1); } else { return null; } } /** * Returns all the commerce shipments where groupId = any ? and status = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param status the status * @return the matching commerce shipments */ @Override public List findByG_S(long[] groupIds, int status) { return findByG_S( groupIds, status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments where groupId = any ? and status = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param status the status * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of matching commerce shipments */ @Override public List findByG_S( long[] groupIds, int status, int start, int end) { return findByG_S(groupIds, status, start, end, null); } /** * Returns an ordered range of all the commerce shipments where groupId = any ? and status = ?. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param status the status * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of matching commerce shipments */ @Override public List findByG_S( long[] groupIds, int status, int start, int end, OrderByComparator orderByComparator) { return findByG_S(groupIds, status, start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments where groupId = ? and status = ?, optionally using the finder cache. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param groupIds the group IDs * @param status the status * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of matching commerce shipments */ @Override public List findByG_S( long[] groupIds, int status, int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { if (groupIds == null) { groupIds = new long[0]; } else if (groupIds.length > 1) { groupIds = ArrayUtil.sortedUnique(groupIds); } if (groupIds.length == 1) { return findByG_S( groupIds[0], status, start, end, orderByComparator); } Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderArgs = new Object[] {StringUtil.merge(groupIds), status}; } } else if (useFinderCache) { finderArgs = new Object[] { StringUtil.merge(groupIds), status, start, end, orderByComparator }; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( _finderPathWithPaginationFindByG_S, finderArgs, this); if ((list != null) && !list.isEmpty()) { for (CommerceShipment commerceShipment : list) { if (!ArrayUtil.contains( groupIds, commerceShipment.getGroupId()) || (status != commerceShipment.getStatus())) { list = null; break; } } } } if (list == null) { StringBundler sb = new StringBundler(); sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); if (groupIds.length > 0) { sb.append("("); sb.append(_FINDER_COLUMN_G_S_GROUPID_7); sb.append(StringUtil.merge(groupIds)); sb.append(")"); sb.append(")"); sb.append(WHERE_AND); } sb.append(_FINDER_COLUMN_G_S_STATUS_2); sb.setStringAt( removeConjunction(sb.stringAt(sb.index() - 1)), sb.index() - 1); if (orderByComparator != null) { appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); } else { sb.append(CommerceShipmentModelImpl.ORDER_BY_JPQL); } String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(status); list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult( _finderPathWithPaginationFindByG_S, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Removes all the commerce shipments where groupId = ? and status = ? from the database. * * @param groupId the group ID * @param status the status */ @Override public void removeByG_S(long groupId, int status) { for (CommerceShipment commerceShipment : findByG_S( groupId, status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(commerceShipment); } } /** * Returns the number of commerce shipments where groupId = ? and status = ?. * * @param groupId the group ID * @param status the status * @return the number of matching commerce shipments */ @Override public int countByG_S(long groupId, int status) { FinderPath finderPath = _finderPathCountByG_S; Object[] finderArgs = new Object[] {groupId, status}; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(3); sb.append(_SQL_COUNT_COMMERCESHIPMENT_WHERE); sb.append(_FINDER_COLUMN_G_S_GROUPID_2); sb.append(_FINDER_COLUMN_G_S_STATUS_2); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(groupId); queryPos.add(status); count = (Long)query.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } /** * Returns the number of commerce shipments where groupId = any ? and status = ?. * * @param groupIds the group IDs * @param status the status * @return the number of matching commerce shipments */ @Override public int countByG_S(long[] groupIds, int status) { if (groupIds == null) { groupIds = new long[0]; } else if (groupIds.length > 1) { groupIds = ArrayUtil.sortedUnique(groupIds); } Object[] finderArgs = new Object[] {StringUtil.merge(groupIds), status}; Long count = (Long)finderCache.getResult( _finderPathWithPaginationCountByG_S, finderArgs, this); if (count == null) { StringBundler sb = new StringBundler(); sb.append(_SQL_COUNT_COMMERCESHIPMENT_WHERE); if (groupIds.length > 0) { sb.append("("); sb.append(_FINDER_COLUMN_G_S_GROUPID_7); sb.append(StringUtil.merge(groupIds)); sb.append(")"); sb.append(")"); sb.append(WHERE_AND); } sb.append(_FINDER_COLUMN_G_S_STATUS_2); sb.setStringAt( removeConjunction(sb.stringAt(sb.index() - 1)), sb.index() - 1); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); queryPos.add(status); count = (Long)query.uniqueResult(); finderCache.putResult( _finderPathWithPaginationCountByG_S, finderArgs, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } private static final String _FINDER_COLUMN_G_S_GROUPID_2 = "commerceShipment.groupId = ? AND "; private static final String _FINDER_COLUMN_G_S_GROUPID_7 = "commerceShipment.groupId IN ("; private static final String _FINDER_COLUMN_G_S_STATUS_2 = "commerceShipment.status = ?"; private FinderPath _finderPathFetchByERC_C; /** * Returns the commerce shipment where externalReferenceCode = ? and companyId = ? or throws a NoSuchShipmentException if it could not be found. * * @param externalReferenceCode the external reference code * @param companyId the company ID * @return the matching commerce shipment * @throws NoSuchShipmentException if a matching commerce shipment could not be found */ @Override public CommerceShipment findByERC_C( String externalReferenceCode, long companyId) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByERC_C( externalReferenceCode, companyId); if (commerceShipment == null) { StringBundler sb = new StringBundler(6); sb.append(_NO_SUCH_ENTITY_WITH_KEY); sb.append("externalReferenceCode="); sb.append(externalReferenceCode); sb.append(", companyId="); sb.append(companyId); sb.append("}"); if (_log.isDebugEnabled()) { _log.debug(sb.toString()); } throw new NoSuchShipmentException(sb.toString()); } return commerceShipment; } /** * Returns the commerce shipment where externalReferenceCode = ? and companyId = ? or returns null if it could not be found. Uses the finder cache. * * @param externalReferenceCode the external reference code * @param companyId the company ID * @return the matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByERC_C( String externalReferenceCode, long companyId) { return fetchByERC_C(externalReferenceCode, companyId, true); } /** * Returns the commerce shipment where externalReferenceCode = ? and companyId = ? or returns null if it could not be found, optionally using the finder cache. * * @param externalReferenceCode the external reference code * @param companyId the company ID * @param useFinderCache whether to use the finder cache * @return the matching commerce shipment, or null if a matching commerce shipment could not be found */ @Override public CommerceShipment fetchByERC_C( String externalReferenceCode, long companyId, boolean useFinderCache) { externalReferenceCode = Objects.toString(externalReferenceCode, ""); Object[] finderArgs = null; if (useFinderCache) { finderArgs = new Object[] {externalReferenceCode, companyId}; } Object result = null; if (useFinderCache) { result = finderCache.getResult( _finderPathFetchByERC_C, finderArgs, this); } if (result instanceof CommerceShipment) { CommerceShipment commerceShipment = (CommerceShipment)result; if (!Objects.equals( externalReferenceCode, commerceShipment.getExternalReferenceCode()) || (companyId != commerceShipment.getCompanyId())) { result = null; } } if (result == null) { StringBundler sb = new StringBundler(4); sb.append(_SQL_SELECT_COMMERCESHIPMENT_WHERE); boolean bindExternalReferenceCode = false; if (externalReferenceCode.isEmpty()) { sb.append(_FINDER_COLUMN_ERC_C_EXTERNALREFERENCECODE_3); } else { bindExternalReferenceCode = true; sb.append(_FINDER_COLUMN_ERC_C_EXTERNALREFERENCECODE_2); } sb.append(_FINDER_COLUMN_ERC_C_COMPANYID_2); String sql = sb.toString(); Session session = null; try { session = openSession(); Query query = session.createQuery(sql); QueryPos queryPos = QueryPos.getInstance(query); if (bindExternalReferenceCode) { queryPos.add(externalReferenceCode); } queryPos.add(companyId); List list = query.list(); if (list.isEmpty()) { if (useFinderCache) { finderCache.putResult( _finderPathFetchByERC_C, finderArgs, list); } } else { CommerceShipment commerceShipment = list.get(0); result = commerceShipment; cacheResult(commerceShipment); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } if (result instanceof List) { return null; } else { return (CommerceShipment)result; } } /** * Removes the commerce shipment where externalReferenceCode = ? and companyId = ? from the database. * * @param externalReferenceCode the external reference code * @param companyId the company ID * @return the commerce shipment that was removed */ @Override public CommerceShipment removeByERC_C( String externalReferenceCode, long companyId) throws NoSuchShipmentException { CommerceShipment commerceShipment = findByERC_C( externalReferenceCode, companyId); return remove(commerceShipment); } /** * Returns the number of commerce shipments where externalReferenceCode = ? and companyId = ?. * * @param externalReferenceCode the external reference code * @param companyId the company ID * @return the number of matching commerce shipments */ @Override public int countByERC_C(String externalReferenceCode, long companyId) { CommerceShipment commerceShipment = fetchByERC_C( externalReferenceCode, companyId); if (commerceShipment == null) { return 0; } return 1; } private static final String _FINDER_COLUMN_ERC_C_EXTERNALREFERENCECODE_2 = "commerceShipment.externalReferenceCode = ? AND "; private static final String _FINDER_COLUMN_ERC_C_EXTERNALREFERENCECODE_3 = "(commerceShipment.externalReferenceCode IS NULL OR commerceShipment.externalReferenceCode = '') AND "; private static final String _FINDER_COLUMN_ERC_C_COMPANYID_2 = "commerceShipment.companyId = ?"; public CommerceShipmentPersistenceImpl() { Map dbColumnNames = new HashMap(); dbColumnNames.put("uuid", "uuid_"); setDBColumnNames(dbColumnNames); setModelClass(CommerceShipment.class); setModelImplClass(CommerceShipmentImpl.class); setModelPKClass(long.class); setTable(CommerceShipmentTable.INSTANCE); } /** * Caches the commerce shipment in the entity cache if it is enabled. * * @param commerceShipment the commerce shipment */ @Override public void cacheResult(CommerceShipment commerceShipment) { entityCache.putResult( CommerceShipmentImpl.class, commerceShipment.getPrimaryKey(), commerceShipment); finderCache.putResult( _finderPathFetchByUUID_G, new Object[] { commerceShipment.getUuid(), commerceShipment.getGroupId() }, commerceShipment); finderCache.putResult( _finderPathFetchByERC_C, new Object[] { commerceShipment.getExternalReferenceCode(), commerceShipment.getCompanyId() }, commerceShipment); } private int _valueObjectFinderCacheListThreshold; /** * Caches the commerce shipments in the entity cache if it is enabled. * * @param commerceShipments the commerce shipments */ @Override public void cacheResult(List commerceShipments) { if ((_valueObjectFinderCacheListThreshold == 0) || ((_valueObjectFinderCacheListThreshold > 0) && (commerceShipments.size() > _valueObjectFinderCacheListThreshold))) { return; } for (CommerceShipment commerceShipment : commerceShipments) { if (entityCache.getResult( CommerceShipmentImpl.class, commerceShipment.getPrimaryKey()) == null) { cacheResult(commerceShipment); } } } /** * Clears the cache for all commerce shipments. * *

* The EntityCache and FinderCache are both cleared by this method. *

*/ @Override public void clearCache() { entityCache.clearCache(CommerceShipmentImpl.class); finderCache.clearCache(CommerceShipmentImpl.class); } /** * Clears the cache for the commerce shipment. * *

* The EntityCache and FinderCache are both cleared by this method. *

*/ @Override public void clearCache(CommerceShipment commerceShipment) { entityCache.removeResult(CommerceShipmentImpl.class, commerceShipment); } @Override public void clearCache(List commerceShipments) { for (CommerceShipment commerceShipment : commerceShipments) { entityCache.removeResult( CommerceShipmentImpl.class, commerceShipment); } } @Override public void clearCache(Set primaryKeys) { finderCache.clearCache(CommerceShipmentImpl.class); for (Serializable primaryKey : primaryKeys) { entityCache.removeResult(CommerceShipmentImpl.class, primaryKey); } } protected void cacheUniqueFindersCache( CommerceShipmentModelImpl commerceShipmentModelImpl) { Object[] args = new Object[] { commerceShipmentModelImpl.getUuid(), commerceShipmentModelImpl.getGroupId() }; finderCache.putResult( _finderPathFetchByUUID_G, args, commerceShipmentModelImpl); args = new Object[] { commerceShipmentModelImpl.getExternalReferenceCode(), commerceShipmentModelImpl.getCompanyId() }; finderCache.putResult( _finderPathFetchByERC_C, args, commerceShipmentModelImpl); } /** * Creates a new commerce shipment with the primary key. Does not add the commerce shipment to the database. * * @param commerceShipmentId the primary key for the new commerce shipment * @return the new commerce shipment */ @Override public CommerceShipment create(long commerceShipmentId) { CommerceShipment commerceShipment = new CommerceShipmentImpl(); commerceShipment.setNew(true); commerceShipment.setPrimaryKey(commerceShipmentId); String uuid = PortalUUIDUtil.generate(); commerceShipment.setUuid(uuid); commerceShipment.setCompanyId(CompanyThreadLocal.getCompanyId()); return commerceShipment; } /** * Removes the commerce shipment with the primary key from the database. Also notifies the appropriate model listeners. * * @param commerceShipmentId the primary key of the commerce shipment * @return the commerce shipment that was removed * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment remove(long commerceShipmentId) throws NoSuchShipmentException { return remove((Serializable)commerceShipmentId); } /** * Removes the commerce shipment with the primary key from the database. Also notifies the appropriate model listeners. * * @param primaryKey the primary key of the commerce shipment * @return the commerce shipment that was removed * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment remove(Serializable primaryKey) throws NoSuchShipmentException { Session session = null; try { session = openSession(); CommerceShipment commerceShipment = (CommerceShipment)session.get( CommerceShipmentImpl.class, primaryKey); if (commerceShipment == null) { if (_log.isDebugEnabled()) { _log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } throw new NoSuchShipmentException( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } return remove(commerceShipment); } catch (NoSuchShipmentException noSuchEntityException) { throw noSuchEntityException; } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } @Override protected CommerceShipment removeImpl(CommerceShipment commerceShipment) { Session session = null; try { session = openSession(); if (!session.contains(commerceShipment)) { commerceShipment = (CommerceShipment)session.get( CommerceShipmentImpl.class, commerceShipment.getPrimaryKeyObj()); } if (commerceShipment != null) { session.delete(commerceShipment); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } if (commerceShipment != null) { clearCache(commerceShipment); } return commerceShipment; } @Override public CommerceShipment updateImpl(CommerceShipment commerceShipment) { boolean isNew = commerceShipment.isNew(); if (!(commerceShipment instanceof CommerceShipmentModelImpl)) { InvocationHandler invocationHandler = null; if (ProxyUtil.isProxyClass(commerceShipment.getClass())) { invocationHandler = ProxyUtil.getInvocationHandler( commerceShipment); throw new IllegalArgumentException( "Implement ModelWrapper in commerceShipment proxy " + invocationHandler.getClass()); } throw new IllegalArgumentException( "Implement ModelWrapper in custom CommerceShipment implementation " + commerceShipment.getClass()); } CommerceShipmentModelImpl commerceShipmentModelImpl = (CommerceShipmentModelImpl)commerceShipment; if (Validator.isNull(commerceShipment.getUuid())) { String uuid = PortalUUIDUtil.generate(); commerceShipment.setUuid(uuid); } if (Validator.isNull(commerceShipment.getExternalReferenceCode())) { commerceShipment.setExternalReferenceCode( commerceShipment.getUuid()); } else { if (!Objects.equals( commerceShipmentModelImpl.getColumnOriginalValue( "externalReferenceCode"), commerceShipment.getExternalReferenceCode())) { long userId = GetterUtil.getLong( PrincipalThreadLocal.getName()); if (userId > 0) { long companyId = commerceShipment.getCompanyId(); long groupId = commerceShipment.getGroupId(); long classPK = 0; if (!isNew) { classPK = commerceShipment.getPrimaryKey(); } try { commerceShipment.setExternalReferenceCode( SanitizerUtil.sanitize( companyId, groupId, userId, CommerceShipment.class.getName(), classPK, ContentTypes.TEXT_HTML, Sanitizer.MODE_ALL, commerceShipment.getExternalReferenceCode(), null)); } catch (SanitizerException sanitizerException) { throw new SystemException(sanitizerException); } } } CommerceShipment ercCommerceShipment = fetchByERC_C( commerceShipment.getExternalReferenceCode(), commerceShipment.getCompanyId()); if (isNew) { if (ercCommerceShipment != null) { throw new DuplicateCommerceShipmentExternalReferenceCodeException( "Duplicate commerce shipment with external reference code " + commerceShipment.getExternalReferenceCode() + " and company " + commerceShipment.getCompanyId()); } } else { if ((ercCommerceShipment != null) && (commerceShipment.getCommerceShipmentId() != ercCommerceShipment.getCommerceShipmentId())) { throw new DuplicateCommerceShipmentExternalReferenceCodeException( "Duplicate commerce shipment with external reference code " + commerceShipment.getExternalReferenceCode() + " and company " + commerceShipment.getCompanyId()); } } } ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext(); Date date = new Date(); if (isNew && (commerceShipment.getCreateDate() == null)) { if (serviceContext == null) { commerceShipment.setCreateDate(date); } else { commerceShipment.setCreateDate( serviceContext.getCreateDate(date)); } } if (!commerceShipmentModelImpl.hasSetModifiedDate()) { if (serviceContext == null) { commerceShipment.setModifiedDate(date); } else { commerceShipment.setModifiedDate( serviceContext.getModifiedDate(date)); } } Session session = null; try { session = openSession(); if (isNew) { session.save(commerceShipment); } else { commerceShipment = (CommerceShipment)session.merge( commerceShipment); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } entityCache.putResult( CommerceShipmentImpl.class, commerceShipmentModelImpl, false, true); cacheUniqueFindersCache(commerceShipmentModelImpl); if (isNew) { commerceShipment.setNew(false); } commerceShipment.resetOriginalValues(); return commerceShipment; } /** * Returns the commerce shipment with the primary key or throws a com.liferay.portal.kernel.exception.NoSuchModelException if it could not be found. * * @param primaryKey the primary key of the commerce shipment * @return the commerce shipment * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment findByPrimaryKey(Serializable primaryKey) throws NoSuchShipmentException { CommerceShipment commerceShipment = fetchByPrimaryKey(primaryKey); if (commerceShipment == null) { if (_log.isDebugEnabled()) { _log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } throw new NoSuchShipmentException( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } return commerceShipment; } /** * Returns the commerce shipment with the primary key or throws a NoSuchShipmentException if it could not be found. * * @param commerceShipmentId the primary key of the commerce shipment * @return the commerce shipment * @throws NoSuchShipmentException if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment findByPrimaryKey(long commerceShipmentId) throws NoSuchShipmentException { return findByPrimaryKey((Serializable)commerceShipmentId); } /** * Returns the commerce shipment with the primary key or returns null if it could not be found. * * @param commerceShipmentId the primary key of the commerce shipment * @return the commerce shipment, or null if a commerce shipment with the primary key could not be found */ @Override public CommerceShipment fetchByPrimaryKey(long commerceShipmentId) { return fetchByPrimaryKey((Serializable)commerceShipmentId); } /** * Returns all the commerce shipments. * * @return the commerce shipments */ @Override public List findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } /** * Returns a range of all the commerce shipments. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @return the range of commerce shipments */ @Override public List findAll(int start, int end) { return findAll(start, end, null); } /** * Returns an ordered range of all the commerce shipments. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @return the ordered range of commerce shipments */ @Override public List findAll( int start, int end, OrderByComparator orderByComparator) { return findAll(start, end, orderByComparator, true); } /** * Returns an ordered range of all the commerce shipments. * *

* Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from CommerceShipmentModelImpl. *

* * @param start the lower bound of the range of commerce shipments * @param end the upper bound of the range of commerce shipments (not inclusive) * @param orderByComparator the comparator to order the results by (optionally null) * @param useFinderCache whether to use the finder cache * @return the ordered range of commerce shipments */ @Override public List findAll( int start, int end, OrderByComparator orderByComparator, boolean useFinderCache) { FinderPath finderPath = null; Object[] finderArgs = null; if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) { if (useFinderCache) { finderPath = _finderPathWithoutPaginationFindAll; finderArgs = FINDER_ARGS_EMPTY; } } else if (useFinderCache) { finderPath = _finderPathWithPaginationFindAll; finderArgs = new Object[] {start, end, orderByComparator}; } List list = null; if (useFinderCache) { list = (List)finderCache.getResult( finderPath, finderArgs, this); } if (list == null) { StringBundler sb = null; String sql = null; if (orderByComparator != null) { sb = new StringBundler( 2 + (orderByComparator.getOrderByFields().length * 2)); sb.append(_SQL_SELECT_COMMERCESHIPMENT); appendOrderByComparator( sb, _ORDER_BY_ENTITY_ALIAS, orderByComparator); sql = sb.toString(); } else { sql = _SQL_SELECT_COMMERCESHIPMENT; sql = sql.concat(CommerceShipmentModelImpl.ORDER_BY_JPQL); } Session session = null; try { session = openSession(); Query query = session.createQuery(sql); list = (List)QueryUtil.list( query, getDialect(), start, end); cacheResult(list); if (useFinderCache) { finderCache.putResult(finderPath, finderArgs, list); } } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return list; } /** * Removes all the commerce shipments from the database. * */ @Override public void removeAll() { for (CommerceShipment commerceShipment : findAll()) { remove(commerceShipment); } } /** * Returns the number of commerce shipments. * * @return the number of commerce shipments */ @Override public int countAll() { Long count = (Long)finderCache.getResult( _finderPathCountAll, FINDER_ARGS_EMPTY, this); if (count == null) { Session session = null; try { session = openSession(); Query query = session.createQuery(_SQL_COUNT_COMMERCESHIPMENT); count = (Long)query.uniqueResult(); finderCache.putResult( _finderPathCountAll, FINDER_ARGS_EMPTY, count); } catch (Exception exception) { throw processException(exception); } finally { closeSession(session); } } return count.intValue(); } @Override public Set getBadColumnNames() { return _badColumnNames; } @Override protected EntityCache getEntityCache() { return entityCache; } @Override protected String getPKDBName() { return "commerceShipmentId"; } @Override protected String getSelectSQL() { return _SQL_SELECT_COMMERCESHIPMENT; } @Override protected Map getTableColumnsMap() { return CommerceShipmentModelImpl.TABLE_COLUMNS_MAP; } /** * Initializes the commerce shipment persistence. */ @Activate public void activate() { _valueObjectFinderCacheListThreshold = GetterUtil.getInteger( PropsUtil.get(PropsKeys.VALUE_OBJECT_FINDER_CACHE_LIST_THRESHOLD)); _finderPathWithPaginationFindAll = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0], new String[0], true); _finderPathWithoutPaginationFindAll = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0], new String[0], true); _finderPathCountAll = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0], new String[0], false); _finderPathWithPaginationFindByUuid = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByUuid", new String[] { String.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() }, new String[] {"uuid_"}, true); _finderPathWithoutPaginationFindByUuid = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByUuid", new String[] {String.class.getName()}, new String[] {"uuid_"}, true); _finderPathCountByUuid = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUuid", new String[] {String.class.getName()}, new String[] {"uuid_"}, false); _finderPathFetchByUUID_G = new FinderPath( FINDER_CLASS_NAME_ENTITY, "fetchByUUID_G", new String[] {String.class.getName(), Long.class.getName()}, new String[] {"uuid_", "groupId"}, true); _finderPathWithPaginationFindByUuid_C = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByUuid_C", new String[] { String.class.getName(), Long.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() }, new String[] {"uuid_", "companyId"}, true); _finderPathWithoutPaginationFindByUuid_C = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByUuid_C", new String[] {String.class.getName(), Long.class.getName()}, new String[] {"uuid_", "companyId"}, true); _finderPathCountByUuid_C = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUuid_C", new String[] {String.class.getName(), Long.class.getName()}, new String[] {"uuid_", "companyId"}, false); _finderPathWithPaginationFindByGroupId = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByGroupId", new String[] { Long.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() }, new String[] {"groupId"}, true); _finderPathWithoutPaginationFindByGroupId = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByGroupId", new String[] {Long.class.getName()}, new String[] {"groupId"}, true); _finderPathCountByGroupId = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByGroupId", new String[] {Long.class.getName()}, new String[] {"groupId"}, false); _finderPathWithPaginationCountByGroupId = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "countByGroupId", new String[] {Long.class.getName()}, new String[] {"groupId"}, false); _finderPathWithPaginationFindByG_C = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByG_C", new String[] { Long.class.getName(), Long.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() }, new String[] {"groupId", "commerceAddressId"}, true); _finderPathWithoutPaginationFindByG_C = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByG_C", new String[] {Long.class.getName(), Long.class.getName()}, new String[] {"groupId", "commerceAddressId"}, true); _finderPathCountByG_C = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByG_C", new String[] {Long.class.getName(), Long.class.getName()}, new String[] {"groupId", "commerceAddressId"}, false); _finderPathWithPaginationCountByG_C = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "countByG_C", new String[] {Long.class.getName(), Long.class.getName()}, new String[] {"groupId", "commerceAddressId"}, false); _finderPathWithPaginationFindByG_S = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByG_S", new String[] { Long.class.getName(), Integer.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() }, new String[] {"groupId", "status"}, true); _finderPathWithoutPaginationFindByG_S = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByG_S", new String[] {Long.class.getName(), Integer.class.getName()}, new String[] {"groupId", "status"}, true); _finderPathCountByG_S = new FinderPath( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByG_S", new String[] {Long.class.getName(), Integer.class.getName()}, new String[] {"groupId", "status"}, false); _finderPathWithPaginationCountByG_S = new FinderPath( FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "countByG_S", new String[] {Long.class.getName(), Integer.class.getName()}, new String[] {"groupId", "status"}, false); _finderPathFetchByERC_C = new FinderPath( FINDER_CLASS_NAME_ENTITY, "fetchByERC_C", new String[] {String.class.getName(), Long.class.getName()}, new String[] {"externalReferenceCode", "companyId"}, true); CommerceShipmentUtil.setPersistence(this); } @Deactivate public void deactivate() { CommerceShipmentUtil.setPersistence(null); entityCache.removeCache(CommerceShipmentImpl.class.getName()); } @Override @Reference( target = CommercePersistenceConstants.SERVICE_CONFIGURATION_FILTER, unbind = "-" ) public void setConfiguration(Configuration configuration) { } @Override @Reference( target = CommercePersistenceConstants.ORIGIN_BUNDLE_SYMBOLIC_NAME_FILTER, unbind = "-" ) public void setDataSource(DataSource dataSource) { super.setDataSource(dataSource); } @Override @Reference( target = CommercePersistenceConstants.ORIGIN_BUNDLE_SYMBOLIC_NAME_FILTER, unbind = "-" ) public void setSessionFactory(SessionFactory sessionFactory) { super.setSessionFactory(sessionFactory); } @Reference protected EntityCache entityCache; @Reference protected FinderCache finderCache; private static final String _SQL_SELECT_COMMERCESHIPMENT = "SELECT commerceShipment FROM CommerceShipment commerceShipment"; private static final String _SQL_SELECT_COMMERCESHIPMENT_WHERE = "SELECT commerceShipment FROM CommerceShipment commerceShipment WHERE "; private static final String _SQL_COUNT_COMMERCESHIPMENT = "SELECT COUNT(commerceShipment) FROM CommerceShipment commerceShipment"; private static final String _SQL_COUNT_COMMERCESHIPMENT_WHERE = "SELECT COUNT(commerceShipment) FROM CommerceShipment commerceShipment WHERE "; private static final String _ORDER_BY_ENTITY_ALIAS = "commerceShipment."; private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No CommerceShipment exists with the primary key "; private static final String _NO_SUCH_ENTITY_WITH_KEY = "No CommerceShipment exists with the key {"; private static final Log _log = LogFactoryUtil.getLog( CommerceShipmentPersistenceImpl.class); private static final Set _badColumnNames = SetUtil.fromArray( new String[] {"uuid"}); @Override protected FinderCache getFinderCache() { return finderCache; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy