--- /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.NoSuchFicheException;
+import com.pentila.entSavoie.carnetDAdresses.model.Fiche;
+import com.pentila.entSavoie.carnetDAdresses.model.impl.FicheImpl;
+import com.pentila.entSavoie.carnetDAdresses.model.impl.FicheModelImpl;
+
+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 fiche service.
+ *
+ * <p>
+ * Caching information and settings can be found in <code>portal.properties</code>
+ * </p>
+ *
+ * @author SIX Lancelot et BARMA Igor
+ * @see FichePersistence
+ * @see FicheUtil
+ * @generated
+ */
+public class FichePersistenceImpl extends BasePersistenceImpl<Fiche>
+ implements FichePersistence {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. Always use {@link FicheUtil} to access the fiche persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
+ */
+ public static final String FINDER_CLASS_NAME_ENTITY = FicheImpl.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(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, FicheImpl.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(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, FicheImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findBygroupId",
+ new String[] { Long.class.getName() },
+ FicheModelImpl.GROUPID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.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_BY_RELUSERID =
+ new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, FicheImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByRelUserId",
+ 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_RELUSERID =
+ new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, FicheImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByRelUserId",
+ new String[] { Long.class.getName() },
+ FicheModelImpl.RELUSERID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_RELUSERID = new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByRelUserId",
+ new String[] { Long.class.getName() });
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_RELUSERIDGROUPID =
+ new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, FicheImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByrelUserIdGroupId",
+ new String[] {
+ Long.class.getName(), 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_RELUSERIDGROUPID =
+ new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, FicheImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "findByrelUserIdGroupId",
+ new String[] { Long.class.getName(), Long.class.getName() },
+ FicheModelImpl.GROUPID_COLUMN_BITMASK |
+ FicheModelImpl.RELUSERID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_RELUSERIDGROUPID = new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "countByrelUserIdGroupId",
+ new String[] { Long.class.getName(), Long.class.getName() });
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, FicheImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
+ public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, FicheImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
+ public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
+
+ /**
+ * Caches the fiche in the entity cache if it is enabled.
+ *
+ * @param fiche the fiche
+ */
+ public void cacheResult(Fiche fiche) {
+ EntityCacheUtil.putResult(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheImpl.class, fiche.getPrimaryKey(), fiche);
+
+ fiche.resetOriginalValues();
+ }
+
+ /**
+ * Caches the fiches in the entity cache if it is enabled.
+ *
+ * @param fiches the fiches
+ */
+ public void cacheResult(List<Fiche> fiches) {
+ for (Fiche fiche : fiches) {
+ if (EntityCacheUtil.getResult(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheImpl.class, fiche.getPrimaryKey()) == null) {
+ cacheResult(fiche);
+ }
+ else {
+ fiche.resetOriginalValues();
+ }
+ }
+ }
+
+ /**
+ * Clears the cache for all fiches.
+ *
+ * <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(FicheImpl.class.getName());
+ }
+
+ EntityCacheUtil.clearCache(FicheImpl.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 fiche.
+ *
+ * <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(Fiche fiche) {
+ EntityCacheUtil.removeResult(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheImpl.class, fiche.getPrimaryKey());
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ @Override
+ public void clearCache(List<Fiche> fiches) {
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+
+ for (Fiche fiche : fiches) {
+ EntityCacheUtil.removeResult(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheImpl.class, fiche.getPrimaryKey());
+ }
+ }
+
+ /**
+ * Creates a new fiche with the primary key. Does not add the fiche to the database.
+ *
+ * @param ficheId the primary key for the new fiche
+ * @return the new fiche
+ */
+ public Fiche create(long ficheId) {
+ Fiche fiche = new FicheImpl();
+
+ fiche.setNew(true);
+ fiche.setPrimaryKey(ficheId);
+
+ return fiche;
+ }
+
+ /**
+ * Removes the fiche with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param ficheId the primary key of the fiche
+ * @return the fiche that was removed
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche remove(long ficheId)
+ throws NoSuchFicheException, SystemException {
+ return remove(Long.valueOf(ficheId));
+ }
+
+ /**
+ * Removes the fiche with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param primaryKey the primary key of the fiche
+ * @return the fiche that was removed
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Fiche remove(Serializable primaryKey)
+ throws NoSuchFicheException, SystemException {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Fiche fiche = (Fiche)session.get(FicheImpl.class, primaryKey);
+
+ if (fiche == null) {
+ if (_log.isWarnEnabled()) {
+ _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ throw new NoSuchFicheException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
+ primaryKey);
+ }
+
+ return remove(fiche);
+ }
+ catch (NoSuchFicheException nsee) {
+ throw nsee;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ @Override
+ protected Fiche removeImpl(Fiche fiche) throws SystemException {
+ fiche = toUnwrappedModel(fiche);
+
+ try {
+ clearListes.clear(fiche.getPrimaryKey());
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ BatchSessionUtil.delete(session, fiche);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ clearCache(fiche);
+
+ return fiche;
+ }
+
+ @Override
+ public Fiche updateImpl(
+ com.pentila.entSavoie.carnetDAdresses.model.Fiche fiche, boolean merge)
+ throws SystemException {
+ fiche = toUnwrappedModel(fiche);
+
+ boolean isNew = fiche.isNew();
+
+ FicheModelImpl ficheModelImpl = (FicheModelImpl)fiche;
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ BatchSessionUtil.update(session, fiche, merge);
+
+ fiche.setNew(false);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+
+ if (isNew || !FicheModelImpl.COLUMN_BITMASK_ENABLED) {
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ else {
+ if ((ficheModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ Long.valueOf(ficheModelImpl.getOriginalGroupId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_GROUPID, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID,
+ args);
+
+ args = new Object[] { Long.valueOf(ficheModelImpl.getGroupId()) };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_GROUPID, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID,
+ args);
+ }
+
+ if ((ficheModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_RELUSERID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ Long.valueOf(ficheModelImpl.getOriginalRelUserId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_RELUSERID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_RELUSERID,
+ args);
+
+ args = new Object[] { Long.valueOf(ficheModelImpl.getRelUserId()) };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_RELUSERID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_RELUSERID,
+ args);
+ }
+
+ if ((ficheModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_RELUSERIDGROUPID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ Long.valueOf(ficheModelImpl.getOriginalGroupId()),
+ Long.valueOf(ficheModelImpl.getOriginalRelUserId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_RELUSERIDGROUPID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_RELUSERIDGROUPID,
+ args);
+
+ args = new Object[] {
+ Long.valueOf(ficheModelImpl.getGroupId()),
+ Long.valueOf(ficheModelImpl.getRelUserId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_RELUSERIDGROUPID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_RELUSERIDGROUPID,
+ args);
+ }
+ }
+
+ EntityCacheUtil.putResult(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheImpl.class, fiche.getPrimaryKey(), fiche);
+
+ return fiche;
+ }
+
+ protected Fiche toUnwrappedModel(Fiche fiche) {
+ if (fiche instanceof FicheImpl) {
+ return fiche;
+ }
+
+ FicheImpl ficheImpl = new FicheImpl();
+
+ ficheImpl.setNew(fiche.isNew());
+ ficheImpl.setPrimaryKey(fiche.getPrimaryKey());
+
+ ficheImpl.setFicheId(fiche.getFicheId());
+ ficheImpl.setGroupId(fiche.getGroupId());
+ ficheImpl.setRelUserId(fiche.getRelUserId());
+ ficheImpl.setProperties(fiche.getProperties());
+
+ return ficheImpl;
+ }
+
+ /**
+ * Returns the fiche 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 fiche
+ * @return the fiche
+ * @throws com.liferay.portal.NoSuchModelException if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Fiche findByPrimaryKey(Serializable primaryKey)
+ throws NoSuchModelException, SystemException {
+ return findByPrimaryKey(((Long)primaryKey).longValue());
+ }
+
+ /**
+ * Returns the fiche with the primary key or throws a {@link com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException} if it could not be found.
+ *
+ * @param ficheId the primary key of the fiche
+ * @return the fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche findByPrimaryKey(long ficheId)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = fetchByPrimaryKey(ficheId);
+
+ if (fiche == null) {
+ if (_log.isWarnEnabled()) {
+ _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + ficheId);
+ }
+
+ throw new NoSuchFicheException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
+ ficheId);
+ }
+
+ return fiche;
+ }
+
+ /**
+ * Returns the fiche with the primary key or returns <code>null</code> if it could not be found.
+ *
+ * @param primaryKey the primary key of the fiche
+ * @return the fiche, or <code>null</code> if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Fiche fetchByPrimaryKey(Serializable primaryKey)
+ throws SystemException {
+ return fetchByPrimaryKey(((Long)primaryKey).longValue());
+ }
+
+ /**
+ * Returns the fiche with the primary key or returns <code>null</code> if it could not be found.
+ *
+ * @param ficheId the primary key of the fiche
+ * @return the fiche, or <code>null</code> if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche fetchByPrimaryKey(long ficheId) throws SystemException {
+ Fiche fiche = (Fiche)EntityCacheUtil.getResult(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheImpl.class, ficheId);
+
+ if (fiche == _nullFiche) {
+ return null;
+ }
+
+ if (fiche == null) {
+ Session session = null;
+
+ boolean hasException = false;
+
+ try {
+ session = openSession();
+
+ fiche = (Fiche)session.get(FicheImpl.class,
+ Long.valueOf(ficheId));
+ }
+ catch (Exception e) {
+ hasException = true;
+
+ throw processException(e);
+ }
+ finally {
+ if (fiche != null) {
+ cacheResult(fiche);
+ }
+ else if (!hasException) {
+ EntityCacheUtil.putResult(FicheModelImpl.ENTITY_CACHE_ENABLED,
+ FicheImpl.class, ficheId, _nullFiche);
+ }
+
+ closeSession(session);
+ }
+ }
+
+ return fiche;
+ }
+
+ /**
+ * Returns all the fiches where groupId = ?.
+ *
+ * @param groupId the group ID
+ * @return the matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findBygroupId(long groupId) throws SystemException {
+ return findBygroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the fiches 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 fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @return the range of matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findBygroupId(long groupId, int start, int end)
+ throws SystemException {
+ return findBygroupId(groupId, start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the fiches 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 fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> 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<Fiche> list = (List<Fiche>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Fiche fiche : list) {
+ if ((groupId != fiche.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_FICHE_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<Fiche>)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 fiche 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 fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche findBygroupId_First(long groupId,
+ OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = fetchBygroupId_First(groupId, orderByComparator);
+
+ if (fiche != null) {
+ return fiche;
+ }
+
+ 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 NoSuchFicheException(msg.toString());
+ }
+
+ /**
+ * Returns the first fiche 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 fiche, or <code>null</code> if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche fetchBygroupId_First(long groupId,
+ OrderByComparator orderByComparator) throws SystemException {
+ List<Fiche> list = findBygroupId(groupId, 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last fiche 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 fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche findBygroupId_Last(long groupId,
+ OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = fetchBygroupId_Last(groupId, orderByComparator);
+
+ if (fiche != null) {
+ return fiche;
+ }
+
+ 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 NoSuchFicheException(msg.toString());
+ }
+
+ /**
+ * Returns the last fiche 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 fiche, or <code>null</code> if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche fetchBygroupId_Last(long groupId,
+ OrderByComparator orderByComparator) throws SystemException {
+ int count = countBygroupId(groupId);
+
+ List<Fiche> list = findBygroupId(groupId, count - 1, count,
+ orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the fiches before and after the current fiche in the ordered set where groupId = ?.
+ *
+ * @param ficheId the primary key of the current fiche
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche[] findBygroupId_PrevAndNext(long ficheId, long groupId,
+ OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = findByPrimaryKey(ficheId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Fiche[] array = new FicheImpl[3];
+
+ array[0] = getBygroupId_PrevAndNext(session, fiche, groupId,
+ orderByComparator, true);
+
+ array[1] = fiche;
+
+ array[2] = getBygroupId_PrevAndNext(session, fiche, groupId,
+ orderByComparator, false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Fiche getBygroupId_PrevAndNext(Session session, Fiche fiche,
+ 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_FICHE_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(fiche);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Fiche> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the fiches where relUserId = ?.
+ *
+ * @param relUserId the rel user ID
+ * @return the matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findByRelUserId(long relUserId)
+ throws SystemException {
+ return findByRelUserId(relUserId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
+ null);
+ }
+
+ /**
+ * Returns a range of all the fiches where relUserId = ?.
+ *
+ * <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 relUserId the rel user ID
+ * @param start the lower bound of the range of fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @return the range of matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findByRelUserId(long relUserId, int start, int end)
+ throws SystemException {
+ return findByRelUserId(relUserId, start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the fiches where relUserId = ?.
+ *
+ * <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 relUserId the rel user ID
+ * @param start the lower bound of the range of fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findByRelUserId(long relUserId, 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_RELUSERID;
+ finderArgs = new Object[] { relUserId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_RELUSERID;
+ finderArgs = new Object[] { relUserId, start, end, orderByComparator };
+ }
+
+ List<Fiche> list = (List<Fiche>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Fiche fiche : list) {
+ if ((relUserId != fiche.getRelUserId())) {
+ 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_FICHE_WHERE);
+
+ query.append(_FINDER_COLUMN_RELUSERID_RELUSERID_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(relUserId);
+
+ list = (List<Fiche>)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 fiche in the ordered set where relUserId = ?.
+ *
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche findByRelUserId_First(long relUserId,
+ OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = fetchByRelUserId_First(relUserId, orderByComparator);
+
+ if (fiche != null) {
+ return fiche;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("relUserId=");
+ msg.append(relUserId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchFicheException(msg.toString());
+ }
+
+ /**
+ * Returns the first fiche in the ordered set where relUserId = ?.
+ *
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching fiche, or <code>null</code> if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche fetchByRelUserId_First(long relUserId,
+ OrderByComparator orderByComparator) throws SystemException {
+ List<Fiche> list = findByRelUserId(relUserId, 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last fiche in the ordered set where relUserId = ?.
+ *
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche findByRelUserId_Last(long relUserId,
+ OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = fetchByRelUserId_Last(relUserId, orderByComparator);
+
+ if (fiche != null) {
+ return fiche;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("relUserId=");
+ msg.append(relUserId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchFicheException(msg.toString());
+ }
+
+ /**
+ * Returns the last fiche in the ordered set where relUserId = ?.
+ *
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching fiche, or <code>null</code> if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche fetchByRelUserId_Last(long relUserId,
+ OrderByComparator orderByComparator) throws SystemException {
+ int count = countByRelUserId(relUserId);
+
+ List<Fiche> list = findByRelUserId(relUserId, count - 1, count,
+ orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the fiches before and after the current fiche in the ordered set where relUserId = ?.
+ *
+ * @param ficheId the primary key of the current fiche
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche[] findByRelUserId_PrevAndNext(long ficheId, long relUserId,
+ OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = findByPrimaryKey(ficheId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Fiche[] array = new FicheImpl[3];
+
+ array[0] = getByRelUserId_PrevAndNext(session, fiche, relUserId,
+ orderByComparator, true);
+
+ array[1] = fiche;
+
+ array[2] = getByRelUserId_PrevAndNext(session, fiche, relUserId,
+ orderByComparator, false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Fiche getByRelUserId_PrevAndNext(Session session, Fiche fiche,
+ long relUserId, 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_FICHE_WHERE);
+
+ query.append(_FINDER_COLUMN_RELUSERID_RELUSERID_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(relUserId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(fiche);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Fiche> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the fiches where groupId = ? and relUserId = ?.
+ *
+ * @param groupId the group ID
+ * @param relUserId the rel user ID
+ * @return the matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findByrelUserIdGroupId(long groupId, long relUserId)
+ throws SystemException {
+ return findByrelUserIdGroupId(groupId, relUserId, QueryUtil.ALL_POS,
+ QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the fiches where groupId = ? and relUserId = ?.
+ *
+ * <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 relUserId the rel user ID
+ * @param start the lower bound of the range of fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @return the range of matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findByrelUserIdGroupId(long groupId, long relUserId,
+ int start, int end) throws SystemException {
+ return findByrelUserIdGroupId(groupId, relUserId, start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the fiches where groupId = ? and relUserId = ?.
+ *
+ * <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 relUserId the rel user ID
+ * @param start the lower bound of the range of fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findByrelUserIdGroupId(long groupId, long relUserId,
+ 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_RELUSERIDGROUPID;
+ finderArgs = new Object[] { groupId, relUserId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_RELUSERIDGROUPID;
+ finderArgs = new Object[] {
+ groupId, relUserId,
+
+ start, end, orderByComparator
+ };
+ }
+
+ List<Fiche> list = (List<Fiche>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Fiche fiche : list) {
+ if ((groupId != fiche.getGroupId()) ||
+ (relUserId != fiche.getRelUserId())) {
+ list = null;
+
+ break;
+ }
+ }
+ }
+
+ if (list == null) {
+ StringBundler query = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(4 +
+ (orderByComparator.getOrderByFields().length * 3));
+ }
+ else {
+ query = new StringBundler(3);
+ }
+
+ query.append(_SQL_SELECT_FICHE_WHERE);
+
+ query.append(_FINDER_COLUMN_RELUSERIDGROUPID_GROUPID_2);
+
+ query.append(_FINDER_COLUMN_RELUSERIDGROUPID_RELUSERID_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);
+
+ qPos.add(relUserId);
+
+ list = (List<Fiche>)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 fiche in the ordered set where groupId = ? and relUserId = ?.
+ *
+ * @param groupId the group ID
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche findByrelUserIdGroupId_First(long groupId, long relUserId,
+ OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = fetchByrelUserIdGroupId_First(groupId, relUserId,
+ orderByComparator);
+
+ if (fiche != null) {
+ return fiche;
+ }
+
+ StringBundler msg = new StringBundler(6);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("groupId=");
+ msg.append(groupId);
+
+ msg.append(", relUserId=");
+ msg.append(relUserId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchFicheException(msg.toString());
+ }
+
+ /**
+ * Returns the first fiche in the ordered set where groupId = ? and relUserId = ?.
+ *
+ * @param groupId the group ID
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching fiche, or <code>null</code> if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche fetchByrelUserIdGroupId_First(long groupId, long relUserId,
+ OrderByComparator orderByComparator) throws SystemException {
+ List<Fiche> list = findByrelUserIdGroupId(groupId, relUserId, 0, 1,
+ orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last fiche in the ordered set where groupId = ? and relUserId = ?.
+ *
+ * @param groupId the group ID
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche findByrelUserIdGroupId_Last(long groupId, long relUserId,
+ OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = fetchByrelUserIdGroupId_Last(groupId, relUserId,
+ orderByComparator);
+
+ if (fiche != null) {
+ return fiche;
+ }
+
+ StringBundler msg = new StringBundler(6);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("groupId=");
+ msg.append(groupId);
+
+ msg.append(", relUserId=");
+ msg.append(relUserId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchFicheException(msg.toString());
+ }
+
+ /**
+ * Returns the last fiche in the ordered set where groupId = ? and relUserId = ?.
+ *
+ * @param groupId the group ID
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching fiche, or <code>null</code> if a matching fiche could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche fetchByrelUserIdGroupId_Last(long groupId, long relUserId,
+ OrderByComparator orderByComparator) throws SystemException {
+ int count = countByrelUserIdGroupId(groupId, relUserId);
+
+ List<Fiche> list = findByrelUserIdGroupId(groupId, relUserId,
+ count - 1, count, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the fiches before and after the current fiche in the ordered set where groupId = ? and relUserId = ?.
+ *
+ * @param ficheId the primary key of the current fiche
+ * @param groupId the group ID
+ * @param relUserId the rel user ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next fiche
+ * @throws com.pentila.entSavoie.carnetDAdresses.NoSuchFicheException if a fiche with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Fiche[] findByrelUserIdGroupId_PrevAndNext(long ficheId,
+ long groupId, long relUserId, OrderByComparator orderByComparator)
+ throws NoSuchFicheException, SystemException {
+ Fiche fiche = findByPrimaryKey(ficheId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Fiche[] array = new FicheImpl[3];
+
+ array[0] = getByrelUserIdGroupId_PrevAndNext(session, fiche,
+ groupId, relUserId, orderByComparator, true);
+
+ array[1] = fiche;
+
+ array[2] = getByrelUserIdGroupId_PrevAndNext(session, fiche,
+ groupId, relUserId, orderByComparator, false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Fiche getByrelUserIdGroupId_PrevAndNext(Session session,
+ Fiche fiche, long groupId, long relUserId,
+ 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_FICHE_WHERE);
+
+ query.append(_FINDER_COLUMN_RELUSERIDGROUPID_GROUPID_2);
+
+ query.append(_FINDER_COLUMN_RELUSERIDGROUPID_RELUSERID_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);
+
+ qPos.add(relUserId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(fiche);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Fiche> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the fiches.
+ *
+ * @return the fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findAll() throws SystemException {
+ return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the fiches.
+ *
+ * <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 fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @return the range of fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> findAll(int start, int end) throws SystemException {
+ return findAll(start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the fiches.
+ *
+ * <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 fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Fiche> 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<Fiche> list = (List<Fiche>)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_FICHE);
+
+ appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
+ orderByComparator);
+
+ sql = query.toString();
+ }
+ else {
+ sql = _SQL_SELECT_FICHE;
+ }
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ if (orderByComparator == null) {
+ list = (List<Fiche>)QueryUtil.list(q, getDialect(), start,
+ end, false);
+
+ Collections.sort(list);
+ }
+ else {
+ list = (List<Fiche>)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 fiches 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 (Fiche fiche : findBygroupId(groupId)) {
+ remove(fiche);
+ }
+ }
+
+ /**
+ * Removes all the fiches where relUserId = ? from the database.
+ *
+ * @param relUserId the rel user ID
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeByRelUserId(long relUserId) throws SystemException {
+ for (Fiche fiche : findByRelUserId(relUserId)) {
+ remove(fiche);
+ }
+ }
+
+ /**
+ * Removes all the fiches where groupId = ? and relUserId = ? from the database.
+ *
+ * @param groupId the group ID
+ * @param relUserId the rel user ID
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeByrelUserIdGroupId(long groupId, long relUserId)
+ throws SystemException {
+ for (Fiche fiche : findByrelUserIdGroupId(groupId, relUserId)) {
+ remove(fiche);
+ }
+ }
+
+ /**
+ * Removes all the fiches from the database.
+ *
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeAll() throws SystemException {
+ for (Fiche fiche : findAll()) {
+ remove(fiche);
+ }
+ }
+
+ /**
+ * Returns the number of fiches where groupId = ?.
+ *
+ * @param groupId the group ID
+ * @return the number of matching fiches
+ * @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_FICHE_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 fiches where relUserId = ?.
+ *
+ * @param relUserId the rel user ID
+ * @return the number of matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public int countByRelUserId(long relUserId) throws SystemException {
+ Object[] finderArgs = new Object[] { relUserId };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_RELUSERID,
+ finderArgs, this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(2);
+
+ query.append(_SQL_COUNT_FICHE_WHERE);
+
+ query.append(_FINDER_COLUMN_RELUSERID_RELUSERID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(relUserId);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_RELUSERID,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns the number of fiches where groupId = ? and relUserId = ?.
+ *
+ * @param groupId the group ID
+ * @param relUserId the rel user ID
+ * @return the number of matching fiches
+ * @throws SystemException if a system exception occurred
+ */
+ public int countByrelUserIdGroupId(long groupId, long relUserId)
+ throws SystemException {
+ Object[] finderArgs = new Object[] { groupId, relUserId };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_RELUSERIDGROUPID,
+ finderArgs, this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(3);
+
+ query.append(_SQL_COUNT_FICHE_WHERE);
+
+ query.append(_FINDER_COLUMN_RELUSERIDGROUPID_GROUPID_2);
+
+ query.append(_FINDER_COLUMN_RELUSERIDGROUPID_RELUSERID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(groupId);
+
+ qPos.add(relUserId);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_RELUSERIDGROUPID,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns the number of fiches.
+ *
+ * @return the number of fiches
+ * @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_FICHE);
+
+ 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 listes associated with the fiche.
+ *
+ * @param pk the primary key of the fiche
+ * @return the listes associated with the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.Liste> getListes(
+ long pk) throws SystemException {
+ return getListes(pk, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
+ }
+
+ /**
+ * Returns a range of all the listes associated with the fiche.
+ *
+ * <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 fiche
+ * @param start the lower bound of the range of fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @return the range of listes associated with the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.Liste> getListes(
+ long pk, int start, int end) throws SystemException {
+ return getListes(pk, start, end, null);
+ }
+
+ public static final FinderPath FINDER_PATH_GET_LISTES = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.ListeModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED_CARNETADRESSES_FICHE_LISTE,
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListeImpl.class,
+ FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME,
+ "getListes",
+ new String[] {
+ Long.class.getName(), "java.lang.Integer", "java.lang.Integer",
+ "com.liferay.portal.kernel.util.OrderByComparator"
+ });
+
+ static {
+ FINDER_PATH_GET_LISTES.setCacheKeyGeneratorCacheName(null);
+ }
+
+ /**
+ * Returns an ordered range of all the listes associated with the fiche.
+ *
+ * <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 fiche
+ * @param start the lower bound of the range of fiches
+ * @param end the upper bound of the range of fiches (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of listes associated with the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public List<com.pentila.entSavoie.carnetDAdresses.model.Liste> getListes(
+ long pk, int start, int end, OrderByComparator orderByComparator)
+ throws SystemException {
+ Object[] finderArgs = new Object[] { pk, start, end, orderByComparator };
+
+ List<com.pentila.entSavoie.carnetDAdresses.model.Liste> list = (List<com.pentila.entSavoie.carnetDAdresses.model.Liste>)FinderCacheUtil.getResult(FINDER_PATH_GET_LISTES,
+ finderArgs, this);
+
+ if (list == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ String sql = null;
+
+ if (orderByComparator != null) {
+ sql = _SQL_GETLISTES.concat(ORDER_BY_CLAUSE)
+ .concat(orderByComparator.getOrderBy());
+ }
+ else {
+ sql = _SQL_GETLISTES;
+ }
+
+ SQLQuery q = session.createSQLQuery(sql);
+
+ q.addEntity("CarnetAdresses_Liste",
+ com.pentila.entSavoie.carnetDAdresses.model.impl.ListeImpl.class);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(pk);
+
+ list = (List<com.pentila.entSavoie.carnetDAdresses.model.Liste>)QueryUtil.list(q,
+ getDialect(), start, end);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (list == null) {
+ FinderCacheUtil.removeResult(FINDER_PATH_GET_LISTES,
+ finderArgs);
+ }
+ else {
+ listePersistence.cacheResult(list);
+
+ FinderCacheUtil.putResult(FINDER_PATH_GET_LISTES,
+ finderArgs, list);
+ }
+
+ closeSession(session);
+ }
+ }
+
+ return list;
+ }
+
+ public static final FinderPath FINDER_PATH_GET_LISTES_SIZE = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.ListeModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED_CARNETADRESSES_FICHE_LISTE,
+ Long.class,
+ FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME,
+ "getListesSize", new String[] { Long.class.getName() });
+
+ static {
+ FINDER_PATH_GET_LISTES_SIZE.setCacheKeyGeneratorCacheName(null);
+ }
+
+ /**
+ * Returns the number of listes associated with the fiche.
+ *
+ * @param pk the primary key of the fiche
+ * @return the number of listes associated with the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public int getListesSize(long pk) throws SystemException {
+ Object[] finderArgs = new Object[] { pk };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_GET_LISTES_SIZE,
+ finderArgs, this);
+
+ if (count == null) {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ SQLQuery q = session.createSQLQuery(_SQL_GETLISTESSIZE);
+
+ 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_LISTES_SIZE,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ public static final FinderPath FINDER_PATH_CONTAINS_LISTE = new FinderPath(com.pentila.entSavoie.carnetDAdresses.model.impl.ListeModelImpl.ENTITY_CACHE_ENABLED,
+ FicheModelImpl.FINDER_CACHE_ENABLED_CARNETADRESSES_FICHE_LISTE,
+ Boolean.class,
+ FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME,
+ "containsListe",
+ new String[] { Long.class.getName(), Long.class.getName() });
+
+ /**
+ * Returns <code>true</code> if the liste is associated with the fiche.
+ *
+ * @param pk the primary key of the fiche
+ * @param listePK the primary key of the liste
+ * @return <code>true</code> if the liste is associated with the fiche; <code>false</code> otherwise
+ * @throws SystemException if a system exception occurred
+ */
+ public boolean containsListe(long pk, long listePK)
+ throws SystemException {
+ Object[] finderArgs = new Object[] { pk, listePK };
+
+ Boolean value = (Boolean)FinderCacheUtil.getResult(FINDER_PATH_CONTAINS_LISTE,
+ finderArgs, this);
+
+ if (value == null) {
+ try {
+ value = Boolean.valueOf(containsListe.contains(pk, listePK));
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (value == null) {
+ value = Boolean.FALSE;
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_CONTAINS_LISTE,
+ finderArgs, value);
+ }
+ }
+
+ return value.booleanValue();
+ }
+
+ /**
+ * Returns <code>true</code> if the fiche has any listes associated with it.
+ *
+ * @param pk the primary key of the fiche to check for associations with listes
+ * @return <code>true</code> if the fiche has any listes associated with it; <code>false</code> otherwise
+ * @throws SystemException if a system exception occurred
+ */
+ public boolean containsListes(long pk) throws SystemException {
+ if (getListesSize(pk) > 0) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ /**
+ * Adds an association between the fiche and the liste. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche
+ * @param listePK the primary key of the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public void addListe(long pk, long listePK) throws SystemException {
+ try {
+ addListe.add(pk, listePK);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Adds an association between the fiche and the liste. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche
+ * @param liste the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public void addListe(long pk,
+ com.pentila.entSavoie.carnetDAdresses.model.Liste liste)
+ throws SystemException {
+ try {
+ addListe.add(pk, liste.getPrimaryKey());
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Adds an association between the fiche and the listes. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche
+ * @param listePKs the primary keys of the listes
+ * @throws SystemException if a system exception occurred
+ */
+ public void addListes(long pk, long[] listePKs) throws SystemException {
+ try {
+ for (long listePK : listePKs) {
+ addListe.add(pk, listePK);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Adds an association between the fiche and the listes. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche
+ * @param listes the listes
+ * @throws SystemException if a system exception occurred
+ */
+ public void addListes(long pk,
+ List<com.pentila.entSavoie.carnetDAdresses.model.Liste> listes)
+ throws SystemException {
+ try {
+ for (com.pentila.entSavoie.carnetDAdresses.model.Liste liste : listes) {
+ addListe.add(pk, liste.getPrimaryKey());
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Clears all associations between the fiche and its listes. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche to clear the associated listes from
+ * @throws SystemException if a system exception occurred
+ */
+ public void clearListes(long pk) throws SystemException {
+ try {
+ clearListes.clear(pk);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Removes the association between the fiche and the liste. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche
+ * @param listePK the primary key of the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeListe(long pk, long listePK) throws SystemException {
+ try {
+ removeListe.remove(pk, listePK);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Removes the association between the fiche and the liste. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche
+ * @param liste the liste
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeListe(long pk,
+ com.pentila.entSavoie.carnetDAdresses.model.Liste liste)
+ throws SystemException {
+ try {
+ removeListe.remove(pk, liste.getPrimaryKey());
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Removes the association between the fiche and the listes. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche
+ * @param listePKs the primary keys of the listes
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeListes(long pk, long[] listePKs)
+ throws SystemException {
+ try {
+ for (long listePK : listePKs) {
+ removeListe.remove(pk, listePK);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Removes the association between the fiche and the listes. Also notifies the appropriate model listeners and clears the mapping table finder cache.
+ *
+ * @param pk the primary key of the fiche
+ * @param listes the listes
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeListes(long pk,
+ List<com.pentila.entSavoie.carnetDAdresses.model.Liste> listes)
+ throws SystemException {
+ try {
+ for (com.pentila.entSavoie.carnetDAdresses.model.Liste liste : listes) {
+ removeListe.remove(pk, liste.getPrimaryKey());
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Sets the listes associated with the fiche, 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 fiche
+ * @param listePKs the primary keys of the listes to be associated with the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public void setListes(long pk, long[] listePKs) throws SystemException {
+ try {
+ Set<Long> listePKSet = SetUtil.fromArray(listePKs);
+
+ List<com.pentila.entSavoie.carnetDAdresses.model.Liste> listes = getListes(pk);
+
+ for (com.pentila.entSavoie.carnetDAdresses.model.Liste liste : listes) {
+ if (!listePKSet.remove(liste.getPrimaryKey())) {
+ removeListe.remove(pk, liste.getPrimaryKey());
+ }
+ }
+
+ for (Long listePK : listePKSet) {
+ addListe.add(pk, listePK);
+ }
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Sets the listes associated with the fiche, 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 fiche
+ * @param listes the listes to be associated with the fiche
+ * @throws SystemException if a system exception occurred
+ */
+ public void setListes(long pk,
+ List<com.pentila.entSavoie.carnetDAdresses.model.Liste> listes)
+ throws SystemException {
+ try {
+ long[] listePKs = new long[listes.size()];
+
+ for (int i = 0; i < listes.size(); i++) {
+ com.pentila.entSavoie.carnetDAdresses.model.Liste liste = listes.get(i);
+
+ listePKs[i] = liste.getPrimaryKey();
+ }
+
+ setListes(pk, listePKs);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ FinderCacheUtil.clearCache(FicheModelImpl.MAPPING_TABLE_CARNETADRESSES_FICHE_LISTE_NAME);
+ }
+ }
+
+ /**
+ * Initializes the fiche persistence.
+ */
+ public void afterPropertiesSet() {
+ String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
+ com.liferay.util.service.ServiceProps.get(
+ "value.object.listener.com.pentila.entSavoie.carnetDAdresses.model.Fiche")));
+
+ if (listenerClassNames.length > 0) {
+ try {
+ List<ModelListener<Fiche>> listenersList = new ArrayList<ModelListener<Fiche>>();
+
+ for (String listenerClassName : listenerClassNames) {
+ listenersList.add((ModelListener<Fiche>)InstanceFactory.newInstance(
+ PortletClassLoaderUtil.getClassLoader(),
+ listenerClassName, (Class<?>[])null, (Object[])null));
+ }
+
+ listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
+ }
+ catch (Exception e) {
+ _log.error(e);
+ }
+ }
+
+ containsListe = new ContainsListe();
+
+ addListe = new AddListe();
+ clearListes = new ClearListes();
+ removeListe = new RemoveListe();
+ }
+
+ public void destroy() {
+ EntityCacheUtil.removeCache(FicheImpl.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 ContainsListe containsListe;
+ protected AddListe addListe;
+ protected ClearListes clearListes;
+ protected RemoveListe removeListe;
+
+ protected class ContainsListe {
+ protected ContainsListe() {
+ _mappingSqlQuery = MappingSqlQueryFactoryUtil.getMappingSqlQuery(getDataSource(),
+ _SQL_CONTAINSLISTE,
+ new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT },
+ RowMapper.COUNT);
+ }
+
+ protected boolean contains(long ficheId, long listeId) {
+ List<Integer> results = _mappingSqlQuery.execute(new Object[] {
+ new Long(ficheId), new Long(listeId)
+ });
+
+ if (results.size() > 0) {
+ Integer count = results.get(0);
+
+ if (count.intValue() > 0) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private MappingSqlQuery<Integer> _mappingSqlQuery;
+ }
+
+ protected class AddListe {
+ protected AddListe() {
+ _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
+ "INSERT INTO CarnetAdresses_Fiche_Liste (ficheId, listeId) VALUES (?, ?)",
+ new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT });
+ }
+
+ protected void add(long ficheId, long listeId)
+ throws SystemException {
+ if (!containsListe.contains(ficheId, listeId)) {
+ ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste>[] listeListeners =
+ listePersistence.getListeners();
+
+ for (ModelListener<Fiche> listener : listeners) {
+ listener.onBeforeAddAssociation(ficheId,
+ com.pentila.entSavoie.carnetDAdresses.model.Liste.class.getName(),
+ listeId);
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste> listener : listeListeners) {
+ listener.onBeforeAddAssociation(listeId,
+ Fiche.class.getName(), ficheId);
+ }
+
+ _sqlUpdate.update(new Object[] {
+ new Long(ficheId), new Long(listeId)
+ });
+
+ for (ModelListener<Fiche> listener : listeners) {
+ listener.onAfterAddAssociation(ficheId,
+ com.pentila.entSavoie.carnetDAdresses.model.Liste.class.getName(),
+ listeId);
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste> listener : listeListeners) {
+ listener.onAfterAddAssociation(listeId,
+ Fiche.class.getName(), ficheId);
+ }
+ }
+ }
+
+ private SqlUpdate _sqlUpdate;
+ }
+
+ protected class ClearListes {
+ protected ClearListes() {
+ _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
+ "DELETE FROM CarnetAdresses_Fiche_Liste WHERE ficheId = ?",
+ new int[] { java.sql.Types.BIGINT });
+ }
+
+ protected void clear(long ficheId) throws SystemException {
+ ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste>[] listeListeners =
+ listePersistence.getListeners();
+
+ List<com.pentila.entSavoie.carnetDAdresses.model.Liste> listes = null;
+
+ if ((listeners.length > 0) || (listeListeners.length > 0)) {
+ listes = getListes(ficheId);
+
+ for (com.pentila.entSavoie.carnetDAdresses.model.Liste liste : listes) {
+ for (ModelListener<Fiche> listener : listeners) {
+ listener.onBeforeRemoveAssociation(ficheId,
+ com.pentila.entSavoie.carnetDAdresses.model.Liste.class.getName(),
+ liste.getPrimaryKey());
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste> listener : listeListeners) {
+ listener.onBeforeRemoveAssociation(liste.getPrimaryKey(),
+ Fiche.class.getName(), ficheId);
+ }
+ }
+ }
+
+ _sqlUpdate.update(new Object[] { new Long(ficheId) });
+
+ if ((listeners.length > 0) || (listeListeners.length > 0)) {
+ for (com.pentila.entSavoie.carnetDAdresses.model.Liste liste : listes) {
+ for (ModelListener<Fiche> listener : listeners) {
+ listener.onAfterRemoveAssociation(ficheId,
+ com.pentila.entSavoie.carnetDAdresses.model.Liste.class.getName(),
+ liste.getPrimaryKey());
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste> listener : listeListeners) {
+ listener.onAfterRemoveAssociation(liste.getPrimaryKey(),
+ Fiche.class.getName(), ficheId);
+ }
+ }
+ }
+ }
+
+ private SqlUpdate _sqlUpdate;
+ }
+
+ protected class RemoveListe {
+ protected RemoveListe() {
+ _sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(getDataSource(),
+ "DELETE FROM CarnetAdresses_Fiche_Liste WHERE ficheId = ? AND listeId = ?",
+ new int[] { java.sql.Types.BIGINT, java.sql.Types.BIGINT });
+ }
+
+ protected void remove(long ficheId, long listeId)
+ throws SystemException {
+ if (containsListe.contains(ficheId, listeId)) {
+ ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste>[] listeListeners =
+ listePersistence.getListeners();
+
+ for (ModelListener<Fiche> listener : listeners) {
+ listener.onBeforeRemoveAssociation(ficheId,
+ com.pentila.entSavoie.carnetDAdresses.model.Liste.class.getName(),
+ listeId);
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste> listener : listeListeners) {
+ listener.onBeforeRemoveAssociation(listeId,
+ Fiche.class.getName(), ficheId);
+ }
+
+ _sqlUpdate.update(new Object[] {
+ new Long(ficheId), new Long(listeId)
+ });
+
+ for (ModelListener<Fiche> listener : listeners) {
+ listener.onAfterRemoveAssociation(ficheId,
+ com.pentila.entSavoie.carnetDAdresses.model.Liste.class.getName(),
+ listeId);
+ }
+
+ for (ModelListener<com.pentila.entSavoie.carnetDAdresses.model.Liste> listener : listeListeners) {
+ listener.onAfterRemoveAssociation(listeId,
+ Fiche.class.getName(), ficheId);
+ }
+ }
+ }
+
+ private SqlUpdate _sqlUpdate;
+ }
+
+ private static final String _SQL_SELECT_FICHE = "SELECT fiche FROM Fiche fiche";
+ private static final String _SQL_SELECT_FICHE_WHERE = "SELECT fiche FROM Fiche fiche WHERE ";
+ private static final String _SQL_COUNT_FICHE = "SELECT COUNT(fiche) FROM Fiche fiche";
+ private static final String _SQL_COUNT_FICHE_WHERE = "SELECT COUNT(fiche) FROM Fiche fiche WHERE ";
+ private static final String _SQL_GETLISTES = "SELECT {CarnetAdresses_Liste.*} FROM CarnetAdresses_Liste INNER JOIN CarnetAdresses_Fiche_Liste ON (CarnetAdresses_Fiche_Liste.listeId = CarnetAdresses_Liste.listeId) WHERE (CarnetAdresses_Fiche_Liste.ficheId = ?)";
+ private static final String _SQL_GETLISTESSIZE = "SELECT COUNT(*) AS COUNT_VALUE FROM CarnetAdresses_Fiche_Liste WHERE ficheId = ?";
+ private static final String _SQL_CONTAINSLISTE = "SELECT COUNT(*) AS COUNT_VALUE FROM CarnetAdresses_Fiche_Liste WHERE ficheId = ? AND listeId = ?";
+ private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "fiche.groupId = ?";
+ private static final String _FINDER_COLUMN_RELUSERID_RELUSERID_2 = "fiche.relUserId = ?";
+ private static final String _FINDER_COLUMN_RELUSERIDGROUPID_GROUPID_2 = "fiche.groupId = ? AND ";
+ private static final String _FINDER_COLUMN_RELUSERIDGROUPID_RELUSERID_2 = "fiche.relUserId = ?";
+ private static final String _ORDER_BY_ENTITY_ALIAS = "fiche.";
+ private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Fiche exists with the primary key ";
+ private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Fiche 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(FichePersistenceImpl.class);
+ private static Fiche _nullFiche = new FicheImpl() {
+ @Override
+ public Object clone() {
+ return this;
+ }
+
+ @Override
+ public CacheModel<Fiche> toCacheModel() {
+ return _nullFicheCacheModel;
+ }
+ };
+
+ private static CacheModel<Fiche> _nullFicheCacheModel = new CacheModel<Fiche>() {
+ public Fiche toEntityModel() {
+ return _nullFiche;
+ }
+ };
+}
\ No newline at end of file