--- /dev/null
+/**
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ */
+
+package com.pentila.entSavoie.carnetDAdresses.service.persistence;
+
+import com.liferay.portal.NoSuchModelException;
+import com.liferay.portal.kernel.bean.BeanReference;
+import com.liferay.portal.kernel.cache.CacheRegistryUtil;
+import com.liferay.portal.kernel.dao.jdbc.MappingSqlQuery;
+import com.liferay.portal.kernel.dao.jdbc.MappingSqlQueryFactoryUtil;
+import com.liferay.portal.kernel.dao.jdbc.RowMapper;
+import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
+import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
+import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
+import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
+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.SQLQuery;
+import com.liferay.portal.kernel.dao.orm.Session;
+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.portlet.PortletClassLoaderUtil;
+import com.liferay.portal.kernel.util.GetterUtil;
+import com.liferay.portal.kernel.util.InstanceFactory;
+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.SetUtil;
+import com.liferay.portal.kernel.util.StringBundler;
+import com.liferay.portal.kernel.util.StringPool;
+import com.liferay.portal.kernel.util.StringUtil;
+import com.liferay.portal.model.CacheModel;
+import com.liferay.portal.model.ModelListener;
+import com.liferay.portal.service.persistence.BatchSessionUtil;
+import com.liferay.portal.service.persistence.ResourcePersistence;
+import com.liferay.portal.service.persistence.UserPersistence;
+import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
+
+import com.pentila.entSavoie.carnetDAdresses.NoSuchListeException;
+import com.pentila.entSavoie.carnetDAdresses.model.Liste;
+import com.pentila.entSavoie.carnetDAdresses.model.impl.ListeImpl;
+import com.pentila.entSavoie.carnetDAdresses.model.impl.ListeModelImpl;
+
+import java.io.Serializable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * The persistence implementation for the liste service.
+ *
+ * <p>
+ * Caching information and settings can be found in <code>portal.properties</code>
+ * </p>
+ *
+ * @author SIX Lancelot et BARMA Igor
+ * @see ListePersistence
+ * @see ListeUtil
+ * @generated
+ */
+public class ListePersistenceImpl extends BasePersistenceImpl<Liste>
+ implements ListePersistence {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. Always use {@link ListeUtil} to access the liste persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
+ */
+ public static final String FINDER_CLASS_NAME_ENTITY = ListeImpl.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";
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_GROUPID = new FinderPath(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED, ListeImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findBygroupId",
+ new String[] {
+ Long.class.getName(),
+
+ "java.lang.Integer", "java.lang.Integer",
+ "com.liferay.portal.kernel.util.OrderByComparator"
+ });
+ public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID =
+ new FinderPath(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED, ListeImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findBygroupId",
+ new String[] { Long.class.getName() },
+ ListeModelImpl.GROUPID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countBygroupId",
+ new String[] { Long.class.getName() });
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED, ListeImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
+ public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED, ListeImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
+ public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
+
+ /**
+ * Caches the liste in the entity cache if it is enabled.
+ *
+ * @param liste the liste
+ */
+ public void cacheResult(Liste liste) {
+ EntityCacheUtil.putResult(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeImpl.class, liste.getPrimaryKey(), liste);
+
+ liste.resetOriginalValues();
+ }
+
+ /**
+ * Caches the listes in the entity cache if it is enabled.
+ *
+ * @param listes the listes
+ */
+ public void cacheResult(List<Liste> listes) {
+ for (Liste liste : listes) {
+ if (EntityCacheUtil.getResult(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeImpl.class, liste.getPrimaryKey()) == null) {
+ cacheResult(liste);
+ }
+ else {
+ liste.resetOriginalValues();
+ }
+ }
+ }
+
+ /**
+ * Clears the cache for all listes.
+ *
+ * <p>
+ * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
+ * </p>
+ */
+ @Override
+ public void clearCache() {
+ if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
+ CacheRegistryUtil.clear(ListeImpl.class.getName());
+ }
+
+ EntityCacheUtil.clearCache(ListeImpl.class.getName());
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ /**
+ * Clears the cache for the liste.
+ *
+ * <p>
+ * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
+ * </p>
+ */
+ @Override
+ public void clearCache(Liste liste) {
+ EntityCacheUtil.removeResult(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeImpl.class, liste.getPrimaryKey());
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ @Override
+ public void clearCache(List<Liste> listes) {
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+
+ for (Liste liste : listes) {
+ EntityCacheUtil.removeResult(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeImpl.class, liste.getPrimaryKey());
+ }
+ }
+
+ /**
+ * Creates a new liste with the primary key. Does not add the liste to the database.
+ *
+ * @param listeId the primary key for the new liste
+ * @return the new liste
+ */
+ public Liste create(long listeId) {
+ Liste liste = new ListeImpl();
+
+ liste.setNew(true);
+ liste.setPrimaryKey(listeId);
+
+ return liste;
+ }
+
+ /**
+ * Removes the liste with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param listeId the primary key of the liste
+ * @return the liste that was removed
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchListeException if a liste with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Liste remove(long listeId)
+ throws NoSuchListeException, SystemException {
+ return remove(Long.valueOf(listeId));
+ }
+
+ /**
+ * Removes the liste with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param primaryKey the primary key of the liste
+ * @return the liste that was removed
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchListeException if a liste with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Liste remove(Serializable primaryKey)
+ throws NoSuchListeException, SystemException {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Liste liste = (Liste)session.get(ListeImpl.class, primaryKey);
+
+ if (liste == null) {
+ if (_log.isWarnEnabled()) {
+ _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ throw new NoSuchListeException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
+ primaryKey);
+ }
+
+ return remove(liste);
+ }
+ catch (NoSuchListeException nsee) {
+ throw nsee;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ @Override
+ protected Liste removeImpl(Liste liste) throws SystemException {
+ liste = toUnwrappedModel(liste);
+
+ try {
+ clearFiches.clear(liste.getPrimaryKey());
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ BatchSessionUtil.delete(session, liste);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ clearCache(liste);
+
+ return liste;
+ }
+
+ @Override
+ public Liste updateImpl(
+ com.pentila.entSavoie.carnetDAdresses.model.Liste liste, boolean merge)
+ throws SystemException {
+ liste = toUnwrappedModel(liste);
+
+ boolean isNew = liste.isNew();
+
+ ListeModelImpl listeModelImpl = (ListeModelImpl)liste;
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ BatchSessionUtil.update(session, liste, merge);
+
+ liste.setNew(false);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+
+ if (isNew || !ListeModelImpl.COLUMN_BITMASK_ENABLED) {
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ else {
+ if ((listeModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ Long.valueOf(listeModelImpl.getOriginalGroupId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_GROUPID, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID,
+ args);
+
+ args = new Object[] { Long.valueOf(listeModelImpl.getGroupId()) };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_GROUPID, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID,
+ args);
+ }
+ }
+
+ EntityCacheUtil.putResult(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeImpl.class, liste.getPrimaryKey(), liste);
+
+ return liste;
+ }
+
+ protected Liste toUnwrappedModel(Liste liste) {
+ if (liste instanceof ListeImpl) {
+ return liste;
+ }
+
+ ListeImpl listeImpl = new ListeImpl();
+
+ listeImpl.setNew(liste.isNew());
+ listeImpl.setPrimaryKey(liste.getPrimaryKey());
+
+ listeImpl.setListeId(liste.getListeId());
+ listeImpl.setGroupId(liste.getGroupId());
+
+ return listeImpl;
+ }
+
+ /**
+ * Returns the liste with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
+ *
+ * @param primaryKey the primary key of the liste
+ * @return the liste
+ * @throws com.liferay.portal.NoSuchModelException if a liste with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Liste findByPrimaryKey(Serializable primaryKey)
+ throws NoSuchModelException, SystemException {
+ return findByPrimaryKey(((Long)primaryKey).longValue());
+ }
+
+ /**
+ * Returns the liste with the primary key or throws a {@link com.pentila.entSavoie.carnetDAdresses.NoSuchListeException} if it could not be found.
+ *
+ * @param listeId the primary key of the liste
+ * @return the liste
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchListeException if a liste with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Liste findByPrimaryKey(long listeId)
+ throws NoSuchListeException, SystemException {
+ Liste liste = fetchByPrimaryKey(listeId);
+
+ if (liste == null) {
+ if (_log.isWarnEnabled()) {
+ _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + listeId);
+ }
+
+ throw new NoSuchListeException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
+ listeId);
+ }
+
+ return liste;
+ }
+
+ /**
+ * Returns the liste with the primary key or returns <code>null</code> if it could not be found.
+ *
+ * @param primaryKey the primary key of the liste
+ * @return the liste, or <code>null</code> if a liste with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Liste fetchByPrimaryKey(Serializable primaryKey)
+ throws SystemException {
+ return fetchByPrimaryKey(((Long)primaryKey).longValue());
+ }
+
+ /**
+ * Returns the liste with the primary key or returns <code>null</code> if it could not be found.
+ *
+ * @param listeId the primary key of the liste
+ * @return the liste, or <code>null</code> if a liste with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Liste fetchByPrimaryKey(long listeId) throws SystemException {
+ Liste liste = (Liste)EntityCacheUtil.getResult(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeImpl.class, listeId);
+
+ if (liste == _nullListe) {
+ return null;
+ }
+
+ if (liste == null) {
+ Session session = null;
+
+ boolean hasException = false;
+
+ try {
+ session = openSession();
+
+ liste = (Liste)session.get(ListeImpl.class,
+ Long.valueOf(listeId));
+ }
+ catch (Exception e) {
+ hasException = true;
+
+ throw processException(e);
+ }
+ finally {
+ if (liste != null) {
+ cacheResult(liste);
+ }
+ else if (!hasException) {
+ EntityCacheUtil.putResult(ListeModelImpl.ENTITY_CACHE_ENABLED,
+ ListeImpl.class, listeId, _nullListe);
+ }
+
+ closeSession(session);
+ }
+ }
+
+ return liste;
+ }
+
+ /**
+ * Returns all the listes where groupId = ?.
+ *
+ * @param groupId the group ID
+ * @return the matching listes
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Liste> findBygroupId(long groupId) throws SystemException {
+ return findBygroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the listes where groupId = ?.
+ *
+ * <p>
+ * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
+ * </p>
+ *
+ * @param groupId the group ID
+ * @param start the lower bound of the range of listes
+ * @param end the upper bound of the range of listes (not inclusive)
+ * @return the range of matching listes
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Liste> findBygroupId(long groupId, int start, int end)
+ throws SystemException {
+ return findBygroupId(groupId, start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the listes where groupId = ?.
+ *
+ * <p>
+ * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
+ * </p>
+ *
+ * @param groupId the group ID
+ * @param start the lower bound of the range of listes
+ * @param end the upper bound of the range of listes (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching listes
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Liste> findBygroupId(long groupId, int start, int end,
+ OrderByComparator orderByComparator) throws SystemException {
+ FinderPath finderPath = null;
+ Object[] finderArgs = null;
+
+ if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
+ (orderByComparator == null)) {
+ finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID;
+ finderArgs = new Object[] { groupId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_GROUPID;
+ finderArgs = new Object[] { groupId, start, end, orderByComparator };
+ }
+
+ List<Liste> list = (List<Liste>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Liste liste : list) {
+ if ((groupId != liste.getGroupId())) {
+ list = null;
+
+ break;
+ }
+ }
+ }
+
+ if (list == null) {
+ StringBundler query = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(3 +
+ (orderByComparator.getOrderByFields().length * 3));
+ }
+ else {
+ query = new StringBundler(2);
+ }
+
+ query.append(_SQL_SELECT_LISTE_WHERE);
+
+ query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
+
+ if (orderByComparator != null) {
+ appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
+ orderByComparator);
+ }
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(groupId);
+
+ list = (List<Liste>)QueryUtil.list(q, getDialect(), start, end);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (list == null) {
+ FinderCacheUtil.removeResult(finderPath, finderArgs);
+ }
+ else {
+ cacheResult(list);
+
+ FinderCacheUtil.putResult(finderPath, finderArgs, list);
+ }
+
+ closeSession(session);
+ }
+ }
+
+ return list;
+ }
+
+ /**
+ * Returns the first liste in the ordered set where groupId = ?.
+ *
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching liste
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchListeException if a matching liste could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Liste findBygroupId_First(long groupId,
+ OrderByComparator orderByComparator)
+ throws NoSuchListeException, SystemException {
+ Liste liste = fetchBygroupId_First(groupId, orderByComparator);
+
+ if (liste != null) {
+ return liste;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("groupId=");
+ msg.append(groupId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchListeException(msg.toString());
+ }
+
+ /**
+ * Returns the first liste in the ordered set where groupId = ?.
+ *
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching liste, or <code>null</code> if a matching liste could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Liste fetchBygroupId_First(long groupId,
+ OrderByComparator orderByComparator) throws SystemException {
+ List<Liste> list = findBygroupId(groupId, 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last liste in the ordered set where groupId = ?.
+ *
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching liste
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchListeException if a matching liste could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Liste findBygroupId_Last(long groupId,
+ OrderByComparator orderByComparator)
+ throws NoSuchListeException, SystemException {
+ Liste liste = fetchBygroupId_Last(groupId, orderByComparator);
+
+ if (liste != null) {
+ return liste;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("groupId=");
+ msg.append(groupId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchListeException(msg.toString());
+ }
+
+ /**
+ * Returns the last liste in the ordered set where groupId = ?.
+ *
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching liste, or <code>null</code> if a matching liste could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Liste fetchBygroupId_Last(long groupId,
+ OrderByComparator orderByComparator) throws SystemException {
+ int count = countBygroupId(groupId);
+
+ List<Liste> list = findBygroupId(groupId, count - 1, count,
+ orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the listes before and after the current liste in the ordered set where groupId = ?.
+ *
+ * @param listeId the primary key of the current liste
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next liste
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchListeException if a liste with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Liste[] findBygroupId_PrevAndNext(long listeId, long groupId,
+ OrderByComparator orderByComparator)
+ throws NoSuchListeException, SystemException {
+ Liste liste = findByPrimaryKey(listeId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Liste[] array = new ListeImpl[3];
+
+ array[0] = getBygroupId_PrevAndNext(session, liste, groupId,
+ orderByComparator, true);
+
+ array[1] = liste;
+
+ array[2] = getBygroupId_PrevAndNext(session, liste, groupId,
+ orderByComparator, false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Liste getBygroupId_PrevAndNext(Session session, Liste liste,
+ long groupId, OrderByComparator orderByComparator, boolean previous) {
+ StringBundler query = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(6 +
+ (orderByComparator.getOrderByFields().length * 6));
+ }
+ else {
+ query = new StringBundler(3);
+ }
+
+ query.append(_SQL_SELECT_LISTE_WHERE);
+
+ query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
+
+ if (orderByComparator != null) {
+ String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
+
+ if (orderByConditionFields.length > 0) {
+ query.append(WHERE_AND);
+ }
+
+ for (int i = 0; i < orderByConditionFields.length; i++) {
+ query.append(_ORDER_BY_ENTITY_ALIAS);
+ query.append(orderByConditionFields[i]);
+
+ if ((i + 1) < orderByConditionFields.length) {
+ if (orderByComparator.isAscending() ^ previous) {
+ query.append(WHERE_GREATER_THAN_HAS_NEXT);
+ }
+ else {
+ query.append(WHERE_LESSER_THAN_HAS_NEXT);
+ }
+ }
+ else {
+ if (orderByComparator.isAscending() ^ previous) {
+ query.append(WHERE_GREATER_THAN);
+ }
+ else {
+ query.append(WHERE_LESSER_THAN);
+ }
+ }
+ }
+
+ query.append(ORDER_BY_CLAUSE);
+
+ String[] orderByFields = orderByComparator.getOrderByFields();
+
+ for (int i = 0; i < orderByFields.length; i++) {
+ query.append(_ORDER_BY_ENTITY_ALIAS);
+ query.append(orderByFields[i]);
+
+ if ((i + 1) < orderByFields.length) {
+ if (orderByComparator.isAscending() ^ previous) {
+ query.append(ORDER_BY_ASC_HAS_NEXT);
+ }
+ else {
+ query.append(ORDER_BY_DESC_HAS_NEXT);
+ }
+ }
+ else {
+ if (orderByComparator.isAscending() ^ previous) {
+ query.append(ORDER_BY_ASC);
+ }
+ else {
+ query.append(ORDER_BY_DESC);
+ }
+ }
+ }
+ }
+
+ String sql = query.toString();
+
+ Query q = session.createQuery(sql);
+
+ q.setFirstResult(0);
+ q.setMaxResults(2);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(groupId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(liste);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Liste> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the listes.
+ *
+ * @return the listes
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Liste> findAll() throws SystemException {
+ return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the listes.
+ *
+ * <p>
+ * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
+ * </p>
+ *
+ * @param start the lower bound of the range of listes
+ * @param end the upper bound of the range of listes (not inclusive)
+ * @return the range of listes
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Liste> findAll(int start, int end) throws SystemException {
+ return findAll(start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the listes.
+ *
+ * <p>
+ * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
+ * </p>
+ *
+ * @param start the lower bound of the range of listes
+ * @param end the upper bound of the range of listes (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of listes
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Liste> findAll(int start, int end,
+ OrderByComparator orderByComparator) throws SystemException {
+ FinderPath finderPath = null;
+ Object[] finderArgs = new Object[] { start, end, orderByComparator };
+
+ if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
+ (orderByComparator == null)) {
+ finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
+ finderArgs = FINDER_ARGS_EMPTY;
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
+ finderArgs = new Object[] { start, end, orderByComparator };
+ }
+
+ List<Liste> list = (List<Liste>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if (list == null) {
+ StringBundler query = null;
+ String sql = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(2 +
+ (orderByComparator.getOrderByFields().length * 3));
+
+ query.append(_SQL_SELECT_LISTE);
+
+ appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
+ orderByComparator);
+
+ sql = query.toString();
+ }
+ else {
+ sql = _SQL_SELECT_LISTE;
+ }
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ if (orderByComparator == null) {
+ list = (List<Liste>)QueryUtil.list(q, getDialect(), start,
+ end, false);
+
+ Collections.sort(list);
+ }
+ else {
+ list = (List<Liste>)QueryUtil.list(q, getDialect(), start,
+ end);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (list == null) {
+ FinderCacheUtil.removeResult(finderPath, finderArgs);
+ }
+ else {
+ cacheResult(list);
+
+ FinderCacheUtil.putResult(finderPath, finderArgs, list);
+ }
+
+ closeSession(session);
+ }
+ }
+
+ return list;
+ }
+
+ /**
+ * Removes all the listes where groupId = ? from the database.
+ *
+ * @param groupId the group ID
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeBygroupId(long groupId) throws SystemException {
+ for (Liste liste : findBygroupId(groupId)) {
+ remove(liste);
+ }
+ }
+
+ /**
+ * Removes all the listes from the database.
+ *
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeAll() throws SystemException {
+ for (Liste liste : findAll()) {
+ remove(liste);
+ }
+ }
+
+ /**
+ * Returns the number of listes where groupId = ?.
+ *
+ * @param groupId the group ID
+ * @return the number of matching listes
+ * @throws SystemException if a system exception occurred
+ */
+ public int countBygroupId(long groupId) throws SystemException {
+ Object[] finderArgs = new Object[] { groupId };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_GROUPID,
+ finderArgs, this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(2);
+
+ query.append(_SQL_COUNT_LISTE_WHERE);
+
+ query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(groupId);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_GROUPID,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns the number of listes.
+ *
+ * @return the number of listes
+ * @throws SystemException if a system exception occurred
+ */
+ public int countAll() throws SystemException {
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
+ FINDER_ARGS_EMPTY, this);
+
+ if (count == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(_SQL_COUNT_LISTE);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
+ FINDER_ARGS_EMPTY, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns all the list properties associated with the liste.
+ *
+ * @param pk the primary key of the liste
+ * @return the list properties associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.ListProperty> getListProperties(
+ long pk) throws SystemException {
+ return getListProperties(pk, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
+ }
+
+ /**
+ * Returns a range of all the list properties associated with the liste.
+ *
+ * <p>
+ * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
+ * </p>
+ *
+ * @param pk the primary key of the liste
+ * @param start the lower bound of the range of listes
+ * @param end the upper bound of the range of listes (not inclusive)
+ * @return the range of list properties associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.ListProperty> getListProperties(
+ long pk, int start, int end) throws SystemException {
+ return getListProperties(pk, start, end, null);
+ }
+
+ public static final FinderPath FINDER_PATH_GET_LISTPROPERTIES = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyModelImpl.ENTITY_CACHE_ENABLED,
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyModelImpl.FINDER_CACHE_ENABLED,
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyImpl.class,
+ com.pentila.entSavoie.carnetDAdresses.service.persistence.ListPropertyPersistenceImpl.FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "getListProperties",
+ new String[] {
+ Long.class.getName(), "java.lang.Integer", "java.lang.Integer",
+ "com.liferay.portal.kernel.util.OrderByComparator"
+ });
+
+ static {
+ FINDER_PATH_GET_LISTPROPERTIES.setCacheKeyGeneratorCacheName(null);
+ }
+
+ /**
+ * Returns an ordered range of all the list properties associated with the liste.
+ *
+ * <p>
+ * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
+ * </p>
+ *
+ * @param pk the primary key of the liste
+ * @param start the lower bound of the range of listes
+ * @param end the upper bound of the range of listes (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of list properties associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.ListProperty> getListProperties(
+ long pk, int start, int end, OrderByComparator orderByComparator)
+ throws SystemException {
+ Object[] finderArgs = new Object[] { pk, start, end, orderByComparator };
+
+ List<com.pentila.entSavoie.carnetDAdresses.model.ListProperty> list = (List<com.pentila.entSavoie.carnetDAdresses.model.ListProperty>)FinderCacheUtil.getResult(FINDER_PATH_GET_LISTPROPERTIES,
+ finderArgs, this);
+
+ if (list == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ String sql = null;
+
+ if (orderByComparator != null) {
+ sql = _SQL_GETLISTPROPERTIES.concat(ORDER_BY_CLAUSE)
+ .concat(orderByComparator.getOrderBy());
+ }
+ else {
+ sql = _SQL_GETLISTPROPERTIES;
+ }
+
+ SQLQuery q = session.createSQLQuery(sql);
+
+ q.addEntity("CarnetAdresses_ListProperty",
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyImpl.class);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(pk);
+
+ list = (List<com.pentila.entSavoie.carnetDAdresses.model.ListProperty>)QueryUtil.list(q,
+ getDialect(), start, end);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (list == null) {
+ FinderCacheUtil.removeResult(FINDER_PATH_GET_LISTPROPERTIES,
+ finderArgs);
+ }
+ else {
+ listPropertyPersistence.cacheResult(list);
+
+ FinderCacheUtil.putResult(FINDER_PATH_GET_LISTPROPERTIES,
+ finderArgs, list);
+ }
+
+ closeSession(session);
+ }
+ }
+
+ return list;
+ }
+
+ public static final FinderPath FINDER_PATH_GET_LISTPROPERTIES_SIZE = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyModelImpl.ENTITY_CACHE_ENABLED,
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyModelImpl.FINDER_CACHE_ENABLED,
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyImpl.class,
+ com.pentila.entSavoie.carnetDAdresses.service.persistence.ListPropertyPersistenceImpl.FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "getListPropertiesSize", new String[] { Long.class.getName() });
+
+ static {
+ FINDER_PATH_GET_LISTPROPERTIES_SIZE.setCacheKeyGeneratorCacheName(null);
+ }
+
+ /**
+ * Returns the number of list properties associated with the liste.
+ *
+ * @param pk the primary key of the liste
+ * @return the number of list properties associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public int getListPropertiesSize(long pk) throws SystemException {
+ Object[] finderArgs = new Object[] { pk };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_GET_LISTPROPERTIES_SIZE,
+ finderArgs, this);
+
+ if (count == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ SQLQuery q = session.createSQLQuery(_SQL_GETLISTPROPERTIESSIZE);
+
+ q.addScalar(COUNT_COLUMN_NAME,
+ com.liferay.portal.kernel.dao.orm.Type.LONG);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(pk);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_GET_LISTPROPERTIES_SIZE,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ public static final FinderPath FINDER_PATH_CONTAINS_LISTPROPERTY = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyModelImpl.ENTITY_CACHE_ENABLED,
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyModelImpl.FINDER_CACHE_ENABLED,
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListPropertyImpl.class,
+ com.pentila.entSavoie.carnetDAdresses.service.persistence.ListPropertyPersistenceImpl.FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "containsListProperty",
+ new String[] { Long.class.getName(), Long.class.getName() });
+
+ /**
+ * Returns <code>true</code> if the list property is associated with the liste.
+ *
+ * @param pk the primary key of the liste
+ * @param listPropertyPK the primary key of the list property
+ * @return <code>true</code> if the list property is associated with the liste; <code>false</code> otherwise
+ * @throws SystemException if a system exception occurred
+ */
+ public boolean containsListProperty(long pk, long listPropertyPK)
+ throws SystemException {
+ Object[] finderArgs = new Object[] { pk, listPropertyPK };
+
+ Boolean value = (Boolean)FinderCacheUtil.getResult(FINDER_PATH_CONTAINS_LISTPROPERTY,
+ finderArgs, this);
+
+ if (value == null) {
+ try {
+ value = Boolean.valueOf(containsListProperty.contains(pk,
+ listPropertyPK));
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (value == null) {
+ value = Boolean.FALSE;
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_CONTAINS_LISTPROPERTY,
+ finderArgs, value);
+ }
+ }
+
+ return value.booleanValue();
+ }
+
+ /**
+ * Returns <code>true</code> if the liste has any list properties associated with it.
+ *
+ * @param pk the primary key of the liste to check for associations with list properties
+ * @return <code>true</code> if the liste has any list properties associated with it; <code>false</code> otherwise
+ * @throws SystemException if a system exception occurred
+ */
+ public boolean containsListProperties(long pk) throws SystemException {
+ if (getListPropertiesSize(pk) > 0) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ /**
+ * Returns all the fiches associated with the liste.
+ *
+ * @param pk the primary key of the liste
+ * @return the fiches associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> getFiches(
+ long pk) throws SystemException {
+ return getFiches(pk, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
+ }
+
+ /**
+ * Returns a range of all the fiches associated with the liste.
+ *
+ * <p>
+ * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
+ * </p>
+ *
+ * @param pk the primary key of the liste
+ * @param start the lower bound of the range of listes
+ * @param end the upper bound of the range of listes (not inclusive)
+ * @return the range of fiches associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> getFiches(
+ long pk, int start, int end) throws SystemException {
+ return getFiches(pk, start, end, null);
+ }
+
+ public static final FinderPath FINDER_PATH_GET_FICHES = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.FicheModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED_CARNETADRESSES_FICHE_LISTE,
+ com.pentila.entSavoie.carnetDAdresses.model.impl.FicheImpl.class,
+ ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME,
+ "getFiches",
+ new String[] {
+ Long.class.getName(), "java.lang.Integer", "java.lang.Integer",
+ "com.liferay.portal.kernel.util.OrderByComparator"
+ });
+
+ static {
+ FINDER_PATH_GET_FICHES.setCacheKeyGeneratorCacheName(null);
+ }
+
+ /**
+ * Returns an ordered range of all the fiches associated with the liste.
+ *
+ * <p>
+ * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
+ * </p>
+ *
+ * @param pk the primary key of the liste
+ * @param start the lower bound of the range of listes
+ * @param end the upper bound of the range of listes (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of fiches associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> getFiches(
+ long pk, int start, int end, OrderByComparator orderByComparator)
+ throws SystemException {
+ Object[] finderArgs = new Object[] { pk, start, end, orderByComparator };
+
+ List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> list = (List<com.pentila.entSavoie.carnetDAdresses.model.Fiche>)FinderCacheUtil.getResult(FINDER_PATH_GET_FICHES,
+ finderArgs, this);
+
+ if (list == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ String sql = null;
+
+ if (orderByComparator != null) {
+ sql = _SQL_GETFICHES.concat(ORDER_BY_CLAUSE)
+ .concat(orderByComparator.getOrderBy());
+ }
+ else {
+ sql = _SQL_GETFICHES;
+ }
+
+ SQLQuery q = session.createSQLQuery(sql);
+
+ q.addEntity("CarnetAdresses_Fiche",
+ com.pentila.entSavoie.carnetDAdresses.model.impl.FicheImpl.class);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(pk);
+
+ list = (List<com.pentila.entSavoie.carnetDAdresses.model.Fiche>)QueryUtil.list(q,
+ getDialect(), start, end);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (list == null) {
+ FinderCacheUtil.removeResult(FINDER_PATH_GET_FICHES,
+ finderArgs);
+ }
+ else {
+ fichePersistence.cacheResult(list);
+
+ FinderCacheUtil.putResult(FINDER_PATH_GET_FICHES,
+ finderArgs, list);
+ }
+
+ closeSession(session);
+ }
+ }
+
+ return list;
+ }
+
+ public static final FinderPath FINDER_PATH_GET_FICHES_SIZE = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.FicheModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED_CARNETADRESSES_FICHE_LISTE,
+ Long.class,
+ ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME,
+ "getFichesSize", new String[] { Long.class.getName() });
+
+ static {
+ FINDER_PATH_GET_FICHES_SIZE.setCacheKeyGeneratorCacheName(null);
+ }
+
+ /**
+ * Returns the number of fiches associated with the liste.
+ *
+ * @param pk the primary key of the liste
+ * @return the number of fiches associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public int getFichesSize(long pk) throws SystemException {
+ Object[] finderArgs = new Object[] { pk };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_GET_FICHES_SIZE,
+ finderArgs, this);
+
+ if (count == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ SQLQuery q = session.createSQLQuery(_SQL_GETFICHESSIZE);
+
+ q.addScalar(COUNT_COLUMN_NAME,
+ com.liferay.portal.kernel.dao.orm.Type.LONG);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(pk);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_GET_FICHES_SIZE,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ public static final FinderPath FINDER_PATH_CONTAINS_FICHE = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.FicheModelImpl.ENTITY_CACHE_ENABLED,
+ ListeModelImpl.FINDER_CACHE_ENABLED_CARNETADRESSES_FICHE_LISTE,
+ Boolean.class,
+ ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME,
+ "containsFiche",
+ new String[] { Long.class.getName(), Long.class.getName() });
+
+ /**
+ * Returns <code>true</code> if the fiche is associated with the liste.
+ *
+ * @param pk the primary key of the liste
+ * @param fichePK the primary key of the fiche
+ * @return <code>true</code> if the fiche is associated with the liste; <code>false</code> otherwise
+ * @throws SystemException if a system exception occurred
+ */
+ public boolean containsFiche(long pk, long fichePK)
+ throws SystemException {
+ Object[] finderArgs = new Object[] { pk, fichePK };
+
+ Boolean value = (Boolean)FinderCacheUtil.getResult(FINDER_PATH_CONTAINS_FICHE,
+ finderArgs, this);
+
+ if (value == null) {
+ try {
+ value = Boolean.valueOf(containsFiche.contains(pk, fichePK));
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (value == null) {
+ value = Boolean.FALSE;
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_CONTAINS_FICHE,
+ finderArgs, value);
+ }
+ }
+
+ return value.booleanValue();
+ }
+
+ /**
+ * Returns <code>true</code> if the liste has any fiches associated with it.
+ *
+ * @param pk the primary key of the liste to check for associations with fiches
+ * @return <code>true</code> if the liste has any fiches associated with it; <code>false</code> otherwise
+ * @throws SystemException if a system exception occurred
+ */
+ public boolean containsFiches(long pk) throws SystemException {
+ if (getFichesSize(pk) > 0) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ /**
+ * Adds an association between the liste and the fiche. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fichePK the primary key of the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public void addFiche(long pk, long fichePK) throws SystemException {
+ try {
+ addFiche.add(pk, fichePK);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Adds an association between the liste and the fiche. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fiche the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public void addFiche(long pk,
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche)
+ throws SystemException {
+ try {
+ addFiche.add(pk, fiche.getPrimaryKey());
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Adds an association between the liste and the fiches. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fichePKs the primary keys of the fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public void addFiches(long pk, long[] fichePKs) throws SystemException {
+ try {
+ for (long fichePK : fichePKs) {
+ addFiche.add(pk, fichePK);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Adds an association between the liste and the fiches. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fiches the fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public void addFiches(long pk,
+ List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> fiches)
+ throws SystemException {
+ try {
+ for (com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche : fiches) {
+ addFiche.add(pk, fiche.getPrimaryKey());
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Clears all associations between the liste and its fiches. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste to clear the associated fiches from
+ * @throws SystemException if a system exception occurred
+ */
+ public void clearFiches(long pk) throws SystemException {
+ try {
+ clearFiches.clear(pk);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Removes the association between the liste and the fiche. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fichePK the primary key of the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeFiche(long pk, long fichePK) throws SystemException {
+ try {
+ removeFiche.remove(pk, fichePK);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Removes the association between the liste and the fiche. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fiche the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeFiche(long pk,
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche)
+ throws SystemException {
+ try {
+ removeFiche.remove(pk, fiche.getPrimaryKey());
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Removes the association between the liste and the fiches. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fichePKs the primary keys of the fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeFiches(long pk, long[] fichePKs)
+ throws SystemException {
+ try {
+ for (long fichePK : fichePKs) {
+ removeFiche.remove(pk, fichePK);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Removes the association between the liste and the fiches. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fiches the fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeFiches(long pk,
+ List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> fiches)
+ throws SystemException {
+ try {
+ for (com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche : fiches) {
+ removeFiche.remove(pk, fiche.getPrimaryKey());
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Sets the fiches associated with the liste, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fichePKs the primary keys of the fiches to be associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public void setFiches(long pk, long[] fichePKs) throws SystemException {
+ try {
+ Set<Long> fichePKSet = SetUtil.fromArray(fichePKs);
+
+ List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> fiches = getFiches(pk);
+
+ for (com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche : fiches) {
+ if (!fichePKSet.remove(fiche.getPrimaryKey())) {
+ removeFiche.remove(pk, fiche.getPrimaryKey());
+ }
+ }
+
+ for (Long fichePK : fichePKSet) {
+ addFiche.add(pk, fichePK);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Sets the fiches associated with the liste, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the liste
+ * @param fiches the fiches to be associated with the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public void setFiches(long pk,
+ List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> fiches)
+ throws SystemException {
+ try {
+ long[] fichePKs = new long[fiches.size()];
+
+ for (int i = 0; i < fiches.size(); i++) {
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche = fiches.get(i);
+
+ fichePKs[i] = fiche.getPrimaryKey();
+ }
+
+ setFiches(pk, fichePKs);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(ListeModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Initializes the liste persistence.
+ */
+ public void afterPropertiesSet() {
+ String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
+ com.liferay.util.service.ServiceProps.get(
+ "value.object.listener.com.pentila.entSavoie.carnetDAdresses.model.Liste")));
+
+ if (listenerClassNames.length > 0) {
+ try {
+ List<ModelListener<Liste>> listenersList = new ArrayList<ModelListener<Liste>>();
+
+ for (String listenerClassName : listenerClassNames) {
+ listenersList.add((ModelListener<Liste>)InstanceFactory.newInstance(
+ PortletClassLoaderUtil.getClassLoader(),
+ listenerClassName, (Class<?>[])null, (Object[])null));
+ }
+
+ listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
+ }
+ catch (Exception e) {
+ _log.error(e);
+ }
+ }
+
+ containsListProperty = new ContainsListProperty();
+
+ containsFiche = new ContainsFiche();
+
+ addFiche = new AddFiche();
+ clearFiches = new ClearFiches();
+ removeFiche = new RemoveFiche();
+ }
+
+ public void destroy() {
+ EntityCacheUtil.removeCache(ListeImpl.class.getName());
+ FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
+ FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ @BeanReference(type = FichePersistence.class)
+ protected FichePersistence fichePersistence;
+ @BeanReference(type = FichePropertyPersistence.class)
+ protected FichePropertyPersistence fichePropertyPersistence;
+ @BeanReference(type = ListePersistence.class)
+ protected ListePersistence listePersistence;
+ @BeanReference(type = ListPropertyPersistence.class)
+ protected ListPropertyPersistence listPropertyPersistence;
+ @BeanReference(type = ResourcePersistence.class)
+ protected ResourcePersistence resourcePersistence;
+ @BeanReference(type = UserPersistence.class)
+ protected UserPersistence userPersistence;
+ protected ContainsListProperty containsListProperty;
+ protected ContainsFiche containsFiche;
+ protected AddFiche addFiche;
+ protected ClearFiches clearFiches;
+ protected RemoveFiche removeFiche;
+
+ protected class ContainsListProperty {
+ protected ContainsListProperty() {
+ _mappingSqlQuery = MappingSqlQueryFactoryUtil.getMappingSqlQuery(getDataSource(),
+ _SQL_CONTAINSLISTPROPERTY,
+ new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT },
+ RowMapper.COUNT);
+ }
+
+ protected boolean contains(long listeId, long propertyId) {
+ List<Integer> results = _mappingSqlQuery.execute(new Object[] {
+ new Long(listeId), new Long(propertyId)
+ });
+
+ if (results.size() > 0) {
+ Integer count = results.get(0);
+
+ if (count.intValue() > 0) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private MappingSqlQuery<Integer> _mappingSqlQuery;
+ }
+
+ protected class ContainsFiche {
+ protected ContainsFiche() {
+ _mappingSqlQuery = MappingSqlQueryFactoryUtil.getMappingSqlQuery(getDataSource(),
+ _SQL_CONTAINSFICHE,
+ new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT },
+ RowMapper.COUNT);
+ }
+
+ protected boolean contains(long listeId, long ficheId) {
+ List<Integer> results = _mappingSqlQuery.execute(new Object[] {
+ new Long(listeId), new Long(ficheId)
+ });
+
+ if (results.size() > 0) {
+ Integer count = results.get(0);
+
+ if (count.intValue() > 0) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private MappingSqlQuery<Integer> _mappingSqlQuery;
+ }
+
+ protected class AddFiche {
+ protected AddFiche() {
+ _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
+ "INSERT INTO CarnetAdresses_Fiche_Liste (listeId, ficheId) VALUES (?, ?)",
+ new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT });
+ }
+
+ protected void add(long listeId, long ficheId)
+ throws SystemException {
+ if (!containsFiche.contains(listeId, ficheId)) {
+ ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche>[] ficheListeners =
+ fichePersistence.getListeners();
+
+ for (ModelListener<Liste> listener : listeners) {
+ listener.onBeforeAddAssociation(listeId,
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche.class.getName(),
+ ficheId);
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche> listener : ficheListeners) {
+ listener.onBeforeAddAssociation(ficheId,
+ Liste.class.getName(), listeId);
+ }
+
+ _sqlUpdate.update(new Object[] {
+ new Long(listeId), new Long(ficheId)
+ });
+
+ for (ModelListener<Liste> listener : listeners) {
+ listener.onAfterAddAssociation(listeId,
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche.class.getName(),
+ ficheId);
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche> listener : ficheListeners) {
+ listener.onAfterAddAssociation(ficheId,
+ Liste.class.getName(), listeId);
+ }
+ }
+ }
+
+ private SqlUpdate _sqlUpdate;
+ }
+
+ protected class ClearFiches {
+ protected ClearFiches() {
+ _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
+ "DELETE FROM CarnetAdresses_Fiche_Liste WHERE listeId = ?",
+ new int[] { java.sql.Types.BIGINT });
+ }
+
+ protected void clear(long listeId) throws SystemException {
+ ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche>[] ficheListeners =
+ fichePersistence.getListeners();
+
+ List<com.pentila.entSavoie.carnetDAdresses.model.Fiche> fiches = null;
+
+ if ((listeners.length > 0) || (ficheListeners.length > 0)) {
+ fiches = getFiches(listeId);
+
+ for (com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche : fiches) {
+ for (ModelListener<Liste> listener : listeners) {
+ listener.onBeforeRemoveAssociation(listeId,
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche.class.getName(),
+ fiche.getPrimaryKey());
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche> listener : ficheListeners) {
+ listener.onBeforeRemoveAssociation(fiche.getPrimaryKey(),
+ Liste.class.getName(), listeId);
+ }
+ }
+ }
+
+ _sqlUpdate.update(new Object[] { new Long(listeId) });
+
+ if ((listeners.length > 0) || (ficheListeners.length > 0)) {
+ for (com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche : fiches) {
+ for (ModelListener<Liste> listener : listeners) {
+ listener.onAfterRemoveAssociation(listeId,
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche.class.getName(),
+ fiche.getPrimaryKey());
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche> listener : ficheListeners) {
+ listener.onAfterRemoveAssociation(fiche.getPrimaryKey(),
+ Liste.class.getName(), listeId);
+ }
+ }
+ }
+ }
+
+ private SqlUpdate _sqlUpdate;
+ }
+
+ protected class RemoveFiche {
+ protected RemoveFiche() {
+ _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
+ "DELETE FROM CarnetAdresses_Fiche_Liste WHERE listeId = ? AND ficheId = ?",
+ new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT });
+ }
+
+ protected void remove(long listeId, long ficheId)
+ throws SystemException {
+ if (containsFiche.contains(listeId, ficheId)) {
+ ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche>[] ficheListeners =
+ fichePersistence.getListeners();
+
+ for (ModelListener<Liste> listener : listeners) {
+ listener.onBeforeRemoveAssociation(listeId,
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche.class.getName(),
+ ficheId);
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche> listener : ficheListeners) {
+ listener.onBeforeRemoveAssociation(ficheId,
+ Liste.class.getName(), listeId);
+ }
+
+ _sqlUpdate.update(new Object[] {
+ new Long(listeId), new Long(ficheId)
+ });
+
+ for (ModelListener<Liste> listener : listeners) {
+ listener.onAfterRemoveAssociation(listeId,
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche.class.getName(),
+ ficheId);
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Fiche> listener : ficheListeners) {
+ listener.onAfterRemoveAssociation(ficheId,
+ Liste.class.getName(), listeId);
+ }
+ }
+ }
+
+ private SqlUpdate _sqlUpdate;
+ }
+
+ private static final String _SQL_SELECT_LISTE = "SELECT liste FROM Liste liste";
+ private static final String _SQL_SELECT_LISTE_WHERE = "SELECT liste FROM Liste liste WHERE ";
+ private static final String _SQL_COUNT_LISTE = "SELECT COUNT(liste) FROM Liste liste";
+ private static final String _SQL_COUNT_LISTE_WHERE = "SELECT COUNT(liste) FROM Liste liste WHERE ";
+ private static final String _SQL_GETLISTPROPERTIES = "SELECT {CarnetAdresses_ListProperty.*} FROM CarnetAdresses_ListProperty INNER JOIN CarnetAdresses_Liste ON (CarnetAdresses_Liste.listeId = CarnetAdresses_ListProperty.listeId) WHERE (CarnetAdresses_Liste.listeId = ?)";
+ private static final String _SQL_GETLISTPROPERTIESSIZE = "SELECT COUNT(*) AS COUNT_VALUE FROM CarnetAdresses_ListProperty WHERE listeId = ?";
+ private static final String _SQL_CONTAINSLISTPROPERTY = "SELECT COUNT(*) AS COUNT_VALUE FROM CarnetAdresses_ListProperty WHERE listeId = ? AND propertyId = ?";
+ private static final String _SQL_GETFICHES = "SELECT {CarnetAdresses_Fiche.*} FROM CarnetAdresses_Fiche INNER JOIN CarnetAdresses_Fiche_Liste ON (CarnetAdresses_Fiche_Liste.ficheId = CarnetAdresses_Fiche.ficheId) WHERE (CarnetAdresses_Fiche_Liste.listeId = ?)";
+ private static final String _SQL_GETFICHESSIZE = "SELECT COUNT(*) AS COUNT_VALUE FROM CarnetAdresses_Fiche_Liste WHERE listeId = ?";
+ private static final String _SQL_CONTAINSFICHE = "SELECT COUNT(*) AS COUNT_VALUE FROM CarnetAdresses_Fiche_Liste WHERE listeId = ? AND ficheId = ?";
+ private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "liste.groupId = ?";
+ private static final String _ORDER_BY_ENTITY_ALIAS = "liste.";
+ private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Liste exists with the primary key ";
+ private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Liste exists with the key {";
+ private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get(
+ PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE));
+ private static Log _log = LogFactoryUtil.getLog(ListePersistenceImpl.class);
+ private static Liste _nullListe = new ListeImpl() {
+ @Override
+ public Object clone() {
+ return this;
+ }
+
+ @Override
+ public CacheModel<Liste> toCacheModel() {
+ return _nullListeCacheModel;
+ }
+ };
+
+ private static CacheModel<Liste> _nullListeCacheModel = new CacheModel<Liste>() {
+ public Liste toEntityModel() {
+ return _nullListe;
+ }
+ };
+}
\ No newline at end of file