--- /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.gestionVieScolaire.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.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.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.CalendarUtil;
+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.StringBundler;
+import com.liferay.portal.kernel.util.StringPool;
+import com.liferay.portal.kernel.util.StringUtil;
+import com.liferay.portal.kernel.util.Validator;
+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.gestionVieScolaire.NoSuchAbsenceException;
+import com.pentila.entSavoie.gestionVieScolaire.model.Absence;
+import com.pentila.entSavoie.gestionVieScolaire.model.impl.AbsenceImpl;
+import com.pentila.entSavoie.gestionVieScolaire.model.impl.AbsenceModelImpl;
+
+import java.io.Serializable;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * The persistence implementation for the absence service.
+ *
+ * <p>
+ * Caching information and settings can be found in <code>portal.properties</code>
+ * </p>
+ *
+ * @author Cédric Lecarpentier
+ * @see AbsencePersistence
+ * @see AbsenceUtil
+ * @generated
+ */
+public class AbsencePersistenceImpl extends BasePersistenceImpl<Absence>
+ implements AbsencePersistence {
+ /*
+ * NOTE FOR DEVELOPERS:
+ *
+ * Never modify or reference this class directly. Always use {@link AbsenceUtil} to access the absence persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
+ */
+ public static final String FINDER_CLASS_NAME_ENTITY = AbsenceImpl.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_ETABID = new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByetabId",
+ 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_ETABID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByetabId",
+ new String[] { Long.class.getName() },
+ AbsenceModelImpl.ETABID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_ETABID = new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByetabId",
+ new String[] { Long.class.getName() });
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_TEACHERID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByteacherId",
+ 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_TEACHERID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByteacherId",
+ new String[] { Long.class.getName() },
+ AbsenceModelImpl.TEACHERID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_TEACHERID = new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByteacherId",
+ new String[] { Long.class.getName() });
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_STARTDATE_ENDDATE_TEACHERID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION,
+ "findBystartDate_endDate_teacherId",
+ new String[] {
+ Date.class.getName(), Date.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_STARTDATE_ENDDATE_TEACHERID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "findBystartDate_endDate_teacherId",
+ new String[] {
+ Date.class.getName(), Date.class.getName(), Long.class.getName()
+ },
+ AbsenceModelImpl.STARTDATE_COLUMN_BITMASK |
+ AbsenceModelImpl.ENDDATE_COLUMN_BITMASK |
+ AbsenceModelImpl.TEACHERID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_TEACHERID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "countBystartDate_endDate_teacherId",
+ new String[] {
+ Date.class.getName(), Date.class.getName(), Long.class.getName()
+ });
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_STARTDATE_ENDDATE_GROUPID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION,
+ "findBystartDate_endDate_groupId",
+ new String[] {
+ Date.class.getName(), Date.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_STARTDATE_ENDDATE_GROUPID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "findBystartDate_endDate_groupId",
+ new String[] {
+ Date.class.getName(), Date.class.getName(), Long.class.getName()
+ },
+ AbsenceModelImpl.STARTDATE_COLUMN_BITMASK |
+ AbsenceModelImpl.ENDDATE_COLUMN_BITMASK |
+ AbsenceModelImpl.GROUPID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_GROUPID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "countBystartDate_endDate_groupId",
+ new String[] {
+ Date.class.getName(), Date.class.getName(), Long.class.getName()
+ });
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_STARTDATE_ENDDATE_SUBCLASSID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION,
+ "findBystartDate_endDate_subClassId",
+ new String[] {
+ Date.class.getName(), Date.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_STARTDATE_ENDDATE_SUBCLASSID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "findBystartDate_endDate_subClassId",
+ new String[] {
+ Date.class.getName(), Date.class.getName(), Long.class.getName()
+ },
+ AbsenceModelImpl.STARTDATE_COLUMN_BITMASK |
+ AbsenceModelImpl.ENDDATE_COLUMN_BITMASK |
+ AbsenceModelImpl.SUBCLASSID_COLUMN_BITMASK);
+ public static final FinderPath FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_SUBCLASSID =
+ new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
+ "countBystartDate_endDate_subClassId",
+ new String[] {
+ Date.class.getName(), Date.class.getName(), Long.class.getName()
+ });
+ public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
+ public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, AbsenceImpl.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
+ public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceModelImpl.FINDER_CACHE_ENABLED, Long.class,
+ FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
+
+ /**
+ * Caches the absence in the entity cache if it is enabled.
+ *
+ * @param absence the absence
+ */
+ public void cacheResult(Absence absence) {
+ EntityCacheUtil.putResult(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceImpl.class, absence.getPrimaryKey(), absence);
+
+ absence.resetOriginalValues();
+ }
+
+ /**
+ * Caches the absences in the entity cache if it is enabled.
+ *
+ * @param absences the absences
+ */
+ public void cacheResult(List<Absence> absences) {
+ for (Absence absence : absences) {
+ if (EntityCacheUtil.getResult(
+ AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceImpl.class, absence.getPrimaryKey()) == null) {
+ cacheResult(absence);
+ }
+ else {
+ absence.resetOriginalValues();
+ }
+ }
+ }
+
+ /**
+ * Clears the cache for all absences.
+ *
+ * <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(AbsenceImpl.class.getName());
+ }
+
+ EntityCacheUtil.clearCache(AbsenceImpl.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 absence.
+ *
+ * <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(Absence absence) {
+ EntityCacheUtil.removeResult(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceImpl.class, absence.getPrimaryKey());
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ @Override
+ public void clearCache(List<Absence> absences) {
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+
+ for (Absence absence : absences) {
+ EntityCacheUtil.removeResult(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceImpl.class, absence.getPrimaryKey());
+ }
+ }
+
+ /**
+ * Creates a new absence with the primary key. Does not add the absence to the database.
+ *
+ * @param absenceId the primary key for the new absence
+ * @return the new absence
+ */
+ public Absence create(long absenceId) {
+ Absence absence = new AbsenceImpl();
+
+ absence.setNew(true);
+ absence.setPrimaryKey(absenceId);
+
+ return absence;
+ }
+
+ /**
+ * Removes the absence with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param absenceId the primary key of the absence
+ * @return the absence that was removed
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence remove(long absenceId)
+ throws NoSuchAbsenceException, SystemException {
+ return remove(Long.valueOf(absenceId));
+ }
+
+ /**
+ * Removes the absence with the primary key from the database. Also notifies the appropriate model listeners.
+ *
+ * @param primaryKey the primary key of the absence
+ * @return the absence that was removed
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Absence remove(Serializable primaryKey)
+ throws NoSuchAbsenceException, SystemException {
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Absence absence = (Absence)session.get(AbsenceImpl.class, primaryKey);
+
+ if (absence == null) {
+ if (_log.isWarnEnabled()) {
+ _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
+ }
+
+ throw new NoSuchAbsenceException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
+ primaryKey);
+ }
+
+ return remove(absence);
+ }
+ catch (NoSuchAbsenceException nsee) {
+ throw nsee;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ @Override
+ protected Absence removeImpl(Absence absence) throws SystemException {
+ absence = toUnwrappedModel(absence);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ BatchSessionUtil.delete(session, absence);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ clearCache(absence);
+
+ return absence;
+ }
+
+ @Override
+ public Absence updateImpl(
+ com.pentila.entSavoie.gestionVieScolaire.model.Absence absence,
+ boolean merge) throws SystemException {
+ absence = toUnwrappedModel(absence);
+
+ boolean isNew = absence.isNew();
+
+ AbsenceModelImpl absenceModelImpl = (AbsenceModelImpl)absence;
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ BatchSessionUtil.update(session, absence, merge);
+
+ absence.setNew(false);
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
+
+ if (isNew || !AbsenceModelImpl.COLUMN_BITMASK_ENABLED) {
+ FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ else {
+ if ((absenceModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ETABID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ Long.valueOf(absenceModelImpl.getOriginalEtabId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ETABID, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ETABID,
+ args);
+
+ args = new Object[] { Long.valueOf(absenceModelImpl.getEtabId()) };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ETABID, args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ETABID,
+ args);
+ }
+
+ if ((absenceModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TEACHERID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ Long.valueOf(absenceModelImpl.getOriginalTeacherId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_TEACHERID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TEACHERID,
+ args);
+
+ args = new Object[] {
+ Long.valueOf(absenceModelImpl.getTeacherId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_TEACHERID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TEACHERID,
+ args);
+ }
+
+ if ((absenceModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_TEACHERID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ absenceModelImpl.getOriginalStartDate(),
+
+ absenceModelImpl.getOriginalEndDate(),
+ Long.valueOf(absenceModelImpl.getOriginalTeacherId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_TEACHERID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_TEACHERID,
+ args);
+
+ args = new Object[] {
+ absenceModelImpl.getStartDate(),
+
+ absenceModelImpl.getEndDate(),
+ Long.valueOf(absenceModelImpl.getTeacherId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_TEACHERID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_TEACHERID,
+ args);
+ }
+
+ if ((absenceModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_GROUPID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ absenceModelImpl.getOriginalStartDate(),
+
+ absenceModelImpl.getOriginalEndDate(),
+ Long.valueOf(absenceModelImpl.getOriginalGroupId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_GROUPID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_GROUPID,
+ args);
+
+ args = new Object[] {
+ absenceModelImpl.getStartDate(),
+
+ absenceModelImpl.getEndDate(),
+ Long.valueOf(absenceModelImpl.getGroupId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_GROUPID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_GROUPID,
+ args);
+ }
+
+ if ((absenceModelImpl.getColumnBitmask() &
+ FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_SUBCLASSID.getColumnBitmask()) != 0) {
+ Object[] args = new Object[] {
+ absenceModelImpl.getOriginalStartDate(),
+
+ absenceModelImpl.getOriginalEndDate(),
+ Long.valueOf(absenceModelImpl.getOriginalSubClassId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_SUBCLASSID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_SUBCLASSID,
+ args);
+
+ args = new Object[] {
+ absenceModelImpl.getStartDate(),
+
+ absenceModelImpl.getEndDate(),
+ Long.valueOf(absenceModelImpl.getSubClassId())
+ };
+
+ FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_SUBCLASSID,
+ args);
+ FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_STARTDATE_ENDDATE_SUBCLASSID,
+ args);
+ }
+ }
+
+ EntityCacheUtil.putResult(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceImpl.class, absence.getPrimaryKey(), absence);
+
+ return absence;
+ }
+
+ protected Absence toUnwrappedModel(Absence absence) {
+ if (absence instanceof AbsenceImpl) {
+ return absence;
+ }
+
+ AbsenceImpl absenceImpl = new AbsenceImpl();
+
+ absenceImpl.setNew(absence.isNew());
+ absenceImpl.setPrimaryKey(absence.getPrimaryKey());
+
+ absenceImpl.setAbsenceId(absence.getAbsenceId());
+ absenceImpl.setEtabId(absence.getEtabId());
+ absenceImpl.setStartDate(absence.getStartDate());
+ absenceImpl.setEndDate(absence.getEndDate());
+ absenceImpl.setTeacherId(absence.getTeacherId());
+ absenceImpl.setGroupId(absence.getGroupId());
+ absenceImpl.setSubClassId(absence.getSubClassId());
+ absenceImpl.setCause(absence.getCause());
+
+ return absenceImpl;
+ }
+
+ /**
+ * Returns the absence 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 absence
+ * @return the absence
+ * @throws com.liferay.portal.NoSuchModelException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Absence findByPrimaryKey(Serializable primaryKey)
+ throws NoSuchModelException, SystemException {
+ return findByPrimaryKey(((Long)primaryKey).longValue());
+ }
+
+ /**
+ * Returns the absence with the primary key or throws a {@link com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException} if it could not be found.
+ *
+ * @param absenceId the primary key of the absence
+ * @return the absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findByPrimaryKey(long absenceId)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchByPrimaryKey(absenceId);
+
+ if (absence == null) {
+ if (_log.isWarnEnabled()) {
+ _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + absenceId);
+ }
+
+ throw new NoSuchAbsenceException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
+ absenceId);
+ }
+
+ return absence;
+ }
+
+ /**
+ * Returns the absence with the primary key or returns <code>null</code> if it could not be found.
+ *
+ * @param primaryKey the primary key of the absence
+ * @return the absence, or <code>null</code> if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ @Override
+ public Absence fetchByPrimaryKey(Serializable primaryKey)
+ throws SystemException {
+ return fetchByPrimaryKey(((Long)primaryKey).longValue());
+ }
+
+ /**
+ * Returns the absence with the primary key or returns <code>null</code> if it could not be found.
+ *
+ * @param absenceId the primary key of the absence
+ * @return the absence, or <code>null</code> if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchByPrimaryKey(long absenceId) throws SystemException {
+ Absence absence = (Absence)EntityCacheUtil.getResult(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceImpl.class, absenceId);
+
+ if (absence == _nullAbsence) {
+ return null;
+ }
+
+ if (absence == null) {
+ Session session = null;
+
+ boolean hasException = false;
+
+ try {
+ session = openSession();
+
+ absence = (Absence)session.get(AbsenceImpl.class,
+ Long.valueOf(absenceId));
+ }
+ catch (Exception e) {
+ hasException = true;
+
+ throw processException(e);
+ }
+ finally {
+ if (absence != null) {
+ cacheResult(absence);
+ }
+ else if (!hasException) {
+ EntityCacheUtil.putResult(AbsenceModelImpl.ENTITY_CACHE_ENABLED,
+ AbsenceImpl.class, absenceId, _nullAbsence);
+ }
+
+ closeSession(session);
+ }
+ }
+
+ return absence;
+ }
+
+ /**
+ * Returns all the absences where etabId = ?.
+ *
+ * @param etabId the etab ID
+ * @return the matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findByetabId(long etabId) throws SystemException {
+ return findByetabId(etabId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the absences where etabId = ?.
+ *
+ * <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 etabId the etab ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @return the range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findByetabId(long etabId, int start, int end)
+ throws SystemException {
+ return findByetabId(etabId, start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the absences where etabId = ?.
+ *
+ * <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 etabId the etab ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findByetabId(long etabId, 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_ETABID;
+ finderArgs = new Object[] { etabId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_ETABID;
+ finderArgs = new Object[] { etabId, start, end, orderByComparator };
+ }
+
+ List<Absence> list = (List<Absence>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Absence absence : list) {
+ if ((etabId != absence.getEtabId())) {
+ 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_ABSENCE_WHERE);
+
+ query.append(_FINDER_COLUMN_ETABID_ETABID_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(etabId);
+
+ list = (List<Absence>)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 absence in the ordered set where etabId = ?.
+ *
+ * @param etabId the etab ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findByetabId_First(long etabId,
+ OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchByetabId_First(etabId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("etabId=");
+ msg.append(etabId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the first absence in the ordered set where etabId = ?.
+ *
+ * @param etabId the etab ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchByetabId_First(long etabId,
+ OrderByComparator orderByComparator) throws SystemException {
+ List<Absence> list = findByetabId(etabId, 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last absence in the ordered set where etabId = ?.
+ *
+ * @param etabId the etab ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findByetabId_Last(long etabId,
+ OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchByetabId_Last(etabId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("etabId=");
+ msg.append(etabId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the last absence in the ordered set where etabId = ?.
+ *
+ * @param etabId the etab ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchByetabId_Last(long etabId,
+ OrderByComparator orderByComparator) throws SystemException {
+ int count = countByetabId(etabId);
+
+ List<Absence> list = findByetabId(etabId, count - 1, count,
+ orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the absences before and after the current absence in the ordered set where etabId = ?.
+ *
+ * @param absenceId the primary key of the current absence
+ * @param etabId the etab ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence[] findByetabId_PrevAndNext(long absenceId, long etabId,
+ OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = findByPrimaryKey(absenceId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Absence[] array = new AbsenceImpl[3];
+
+ array[0] = getByetabId_PrevAndNext(session, absence, etabId,
+ orderByComparator, true);
+
+ array[1] = absence;
+
+ array[2] = getByetabId_PrevAndNext(session, absence, etabId,
+ orderByComparator, false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Absence getByetabId_PrevAndNext(Session session, Absence absence,
+ long etabId, 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_ABSENCE_WHERE);
+
+ query.append(_FINDER_COLUMN_ETABID_ETABID_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(etabId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(absence);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Absence> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the absences where teacherId = ?.
+ *
+ * @param teacherId the teacher ID
+ * @return the matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findByteacherId(long teacherId)
+ throws SystemException {
+ return findByteacherId(teacherId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
+ null);
+ }
+
+ /**
+ * Returns a range of all the absences where teacherId = ?.
+ *
+ * <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 teacherId the teacher ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @return the range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findByteacherId(long teacherId, int start, int end)
+ throws SystemException {
+ return findByteacherId(teacherId, start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the absences where teacherId = ?.
+ *
+ * <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 teacherId the teacher ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findByteacherId(long teacherId, 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_TEACHERID;
+ finderArgs = new Object[] { teacherId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_TEACHERID;
+ finderArgs = new Object[] { teacherId, start, end, orderByComparator };
+ }
+
+ List<Absence> list = (List<Absence>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Absence absence : list) {
+ if ((teacherId != absence.getTeacherId())) {
+ 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_ABSENCE_WHERE);
+
+ query.append(_FINDER_COLUMN_TEACHERID_TEACHERID_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(teacherId);
+
+ list = (List<Absence>)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 absence in the ordered set where teacherId = ?.
+ *
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findByteacherId_First(long teacherId,
+ OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchByteacherId_First(teacherId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("teacherId=");
+ msg.append(teacherId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the first absence in the ordered set where teacherId = ?.
+ *
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchByteacherId_First(long teacherId,
+ OrderByComparator orderByComparator) throws SystemException {
+ List<Absence> list = findByteacherId(teacherId, 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last absence in the ordered set where teacherId = ?.
+ *
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findByteacherId_Last(long teacherId,
+ OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchByteacherId_Last(teacherId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(4);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("teacherId=");
+ msg.append(teacherId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the last absence in the ordered set where teacherId = ?.
+ *
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchByteacherId_Last(long teacherId,
+ OrderByComparator orderByComparator) throws SystemException {
+ int count = countByteacherId(teacherId);
+
+ List<Absence> list = findByteacherId(teacherId, count - 1, count,
+ orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the absences before and after the current absence in the ordered set where teacherId = ?.
+ *
+ * @param absenceId the primary key of the current absence
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence[] findByteacherId_PrevAndNext(long absenceId,
+ long teacherId, OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = findByPrimaryKey(absenceId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Absence[] array = new AbsenceImpl[3];
+
+ array[0] = getByteacherId_PrevAndNext(session, absence, teacherId,
+ orderByComparator, true);
+
+ array[1] = absence;
+
+ array[2] = getByteacherId_PrevAndNext(session, absence, teacherId,
+ orderByComparator, false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Absence getByteacherId_PrevAndNext(Session session,
+ Absence absence, long teacherId, 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_ABSENCE_WHERE);
+
+ query.append(_FINDER_COLUMN_TEACHERID_TEACHERID_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(teacherId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(absence);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Absence> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the absences where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @return the matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_teacherId(Date startDate,
+ Date endDate, long teacherId) throws SystemException {
+ return findBystartDate_endDate_teacherId(startDate, endDate, teacherId,
+ QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the absences where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * <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 startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @return the range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_teacherId(Date startDate,
+ Date endDate, long teacherId, int start, int end)
+ throws SystemException {
+ return findBystartDate_endDate_teacherId(startDate, endDate, teacherId,
+ start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the absences where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * <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 startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_teacherId(Date startDate,
+ Date endDate, long teacherId, 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_STARTDATE_ENDDATE_TEACHERID;
+ finderArgs = new Object[] { startDate, endDate, teacherId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_STARTDATE_ENDDATE_TEACHERID;
+ finderArgs = new Object[] {
+ startDate, endDate, teacherId,
+
+ start, end, orderByComparator
+ };
+ }
+
+ List<Absence> list = (List<Absence>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Absence absence : list) {
+ if (!Validator.equals(startDate, absence.getStartDate()) ||
+ !Validator.equals(endDate, absence.getEndDate()) ||
+ (teacherId != absence.getTeacherId())) {
+ list = null;
+
+ break;
+ }
+ }
+ }
+
+ if (list == null) {
+ StringBundler query = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(5 +
+ (orderByComparator.getOrderByFields().length * 3));
+ }
+ else {
+ query = new StringBundler(4);
+ }
+
+ query.append(_SQL_SELECT_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_TEACHERID_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);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ qPos.add(teacherId);
+
+ list = (List<Absence>)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 absence in the ordered set where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findBystartDate_endDate_teacherId_First(Date startDate,
+ Date endDate, long teacherId, OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchBystartDate_endDate_teacherId_First(startDate,
+ endDate, teacherId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(8);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("startDate=");
+ msg.append(startDate);
+
+ msg.append(", endDate=");
+ msg.append(endDate);
+
+ msg.append(", teacherId=");
+ msg.append(teacherId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the first absence in the ordered set where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchBystartDate_endDate_teacherId_First(Date startDate,
+ Date endDate, long teacherId, OrderByComparator orderByComparator)
+ throws SystemException {
+ List<Absence> list = findBystartDate_endDate_teacherId(startDate,
+ endDate, teacherId, 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last absence in the ordered set where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findBystartDate_endDate_teacherId_Last(Date startDate,
+ Date endDate, long teacherId, OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchBystartDate_endDate_teacherId_Last(startDate,
+ endDate, teacherId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(8);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("startDate=");
+ msg.append(startDate);
+
+ msg.append(", endDate=");
+ msg.append(endDate);
+
+ msg.append(", teacherId=");
+ msg.append(teacherId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the last absence in the ordered set where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchBystartDate_endDate_teacherId_Last(Date startDate,
+ Date endDate, long teacherId, OrderByComparator orderByComparator)
+ throws SystemException {
+ int count = countBystartDate_endDate_teacherId(startDate, endDate,
+ teacherId);
+
+ List<Absence> list = findBystartDate_endDate_teacherId(startDate,
+ endDate, teacherId, count - 1, count, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the absences before and after the current absence in the ordered set where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * @param absenceId the primary key of the current absence
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence[] findBystartDate_endDate_teacherId_PrevAndNext(
+ long absenceId, Date startDate, Date endDate, long teacherId,
+ OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = findByPrimaryKey(absenceId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Absence[] array = new AbsenceImpl[3];
+
+ array[0] = getBystartDate_endDate_teacherId_PrevAndNext(session,
+ absence, startDate, endDate, teacherId, orderByComparator,
+ true);
+
+ array[1] = absence;
+
+ array[2] = getBystartDate_endDate_teacherId_PrevAndNext(session,
+ absence, startDate, endDate, teacherId, orderByComparator,
+ false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Absence getBystartDate_endDate_teacherId_PrevAndNext(
+ Session session, Absence absence, Date startDate, Date endDate,
+ long teacherId, 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_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_TEACHERID_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);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ qPos.add(teacherId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(absence);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Absence> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the absences where startDate = ? and endDate = ? and groupId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @return the matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_groupId(Date startDate,
+ Date endDate, long groupId) throws SystemException {
+ return findBystartDate_endDate_groupId(startDate, endDate, groupId,
+ QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the absences where startDate = ? and endDate = ? and 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 startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @return the range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_groupId(Date startDate,
+ Date endDate, long groupId, int start, int end)
+ throws SystemException {
+ return findBystartDate_endDate_groupId(startDate, endDate, groupId,
+ start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the absences where startDate = ? and endDate = ? and 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 startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_groupId(Date startDate,
+ Date endDate, 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_STARTDATE_ENDDATE_GROUPID;
+ finderArgs = new Object[] { startDate, endDate, groupId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_STARTDATE_ENDDATE_GROUPID;
+ finderArgs = new Object[] {
+ startDate, endDate, groupId,
+
+ start, end, orderByComparator
+ };
+ }
+
+ List<Absence> list = (List<Absence>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Absence absence : list) {
+ if (!Validator.equals(startDate, absence.getStartDate()) ||
+ !Validator.equals(endDate, absence.getEndDate()) ||
+ (groupId != absence.getGroupId())) {
+ list = null;
+
+ break;
+ }
+ }
+ }
+
+ if (list == null) {
+ StringBundler query = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(5 +
+ (orderByComparator.getOrderByFields().length * 3));
+ }
+ else {
+ query = new StringBundler(4);
+ }
+
+ query.append(_SQL_SELECT_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_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);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ qPos.add(groupId);
+
+ list = (List<Absence>)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 absence in the ordered set where startDate = ? and endDate = ? and groupId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findBystartDate_endDate_groupId_First(Date startDate,
+ Date endDate, long groupId, OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchBystartDate_endDate_groupId_First(startDate,
+ endDate, groupId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(8);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("startDate=");
+ msg.append(startDate);
+
+ msg.append(", endDate=");
+ msg.append(endDate);
+
+ msg.append(", groupId=");
+ msg.append(groupId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the first absence in the ordered set where startDate = ? and endDate = ? and groupId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchBystartDate_endDate_groupId_First(Date startDate,
+ Date endDate, long groupId, OrderByComparator orderByComparator)
+ throws SystemException {
+ List<Absence> list = findBystartDate_endDate_groupId(startDate,
+ endDate, groupId, 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last absence in the ordered set where startDate = ? and endDate = ? and groupId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findBystartDate_endDate_groupId_Last(Date startDate,
+ Date endDate, long groupId, OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchBystartDate_endDate_groupId_Last(startDate,
+ endDate, groupId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(8);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("startDate=");
+ msg.append(startDate);
+
+ msg.append(", endDate=");
+ msg.append(endDate);
+
+ msg.append(", groupId=");
+ msg.append(groupId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the last absence in the ordered set where startDate = ? and endDate = ? and groupId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchBystartDate_endDate_groupId_Last(Date startDate,
+ Date endDate, long groupId, OrderByComparator orderByComparator)
+ throws SystemException {
+ int count = countBystartDate_endDate_groupId(startDate, endDate, groupId);
+
+ List<Absence> list = findBystartDate_endDate_groupId(startDate,
+ endDate, groupId, count - 1, count, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the absences before and after the current absence in the ordered set where startDate = ? and endDate = ? and groupId = ?.
+ *
+ * @param absenceId the primary key of the current absence
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence[] findBystartDate_endDate_groupId_PrevAndNext(
+ long absenceId, Date startDate, Date endDate, long groupId,
+ OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = findByPrimaryKey(absenceId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Absence[] array = new AbsenceImpl[3];
+
+ array[0] = getBystartDate_endDate_groupId_PrevAndNext(session,
+ absence, startDate, endDate, groupId, orderByComparator,
+ true);
+
+ array[1] = absence;
+
+ array[2] = getBystartDate_endDate_groupId_PrevAndNext(session,
+ absence, startDate, endDate, groupId, orderByComparator,
+ false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Absence getBystartDate_endDate_groupId_PrevAndNext(
+ Session session, Absence absence, Date startDate, Date endDate,
+ 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_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_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);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ qPos.add(groupId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(absence);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Absence> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the absences where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @return the matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_subClassId(Date startDate,
+ Date endDate, long subClassId) throws SystemException {
+ return findBystartDate_endDate_subClassId(startDate, endDate,
+ subClassId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the absences where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * <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 startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @return the range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_subClassId(Date startDate,
+ Date endDate, long subClassId, int start, int end)
+ throws SystemException {
+ return findBystartDate_endDate_subClassId(startDate, endDate,
+ subClassId, start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the absences where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * <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 startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @param start the lower bound of the range of absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findBystartDate_endDate_subClassId(Date startDate,
+ Date endDate, long subClassId, 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_STARTDATE_ENDDATE_SUBCLASSID;
+ finderArgs = new Object[] { startDate, endDate, subClassId };
+ }
+ else {
+ finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_STARTDATE_ENDDATE_SUBCLASSID;
+ finderArgs = new Object[] {
+ startDate, endDate, subClassId,
+
+ start, end, orderByComparator
+ };
+ }
+
+ List<Absence> list = (List<Absence>)FinderCacheUtil.getResult(finderPath,
+ finderArgs, this);
+
+ if ((list != null) && !list.isEmpty()) {
+ for (Absence absence : list) {
+ if (!Validator.equals(startDate, absence.getStartDate()) ||
+ !Validator.equals(endDate, absence.getEndDate()) ||
+ (subClassId != absence.getSubClassId())) {
+ list = null;
+
+ break;
+ }
+ }
+ }
+
+ if (list == null) {
+ StringBundler query = null;
+
+ if (orderByComparator != null) {
+ query = new StringBundler(5 +
+ (orderByComparator.getOrderByFields().length * 3));
+ }
+ else {
+ query = new StringBundler(4);
+ }
+
+ query.append(_SQL_SELECT_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_SUBCLASSID_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);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ qPos.add(subClassId);
+
+ list = (List<Absence>)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 absence in the ordered set where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findBystartDate_endDate_subClassId_First(Date startDate,
+ Date endDate, long subClassId, OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchBystartDate_endDate_subClassId_First(startDate,
+ endDate, subClassId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(8);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("startDate=");
+ msg.append(startDate);
+
+ msg.append(", endDate=");
+ msg.append(endDate);
+
+ msg.append(", subClassId=");
+ msg.append(subClassId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the first absence in the ordered set where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the first matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchBystartDate_endDate_subClassId_First(Date startDate,
+ Date endDate, long subClassId, OrderByComparator orderByComparator)
+ throws SystemException {
+ List<Absence> list = findBystartDate_endDate_subClassId(startDate,
+ endDate, subClassId, 0, 1, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the last absence in the ordered set where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence findBystartDate_endDate_subClassId_Last(Date startDate,
+ Date endDate, long subClassId, OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = fetchBystartDate_endDate_subClassId_Last(startDate,
+ endDate, subClassId, orderByComparator);
+
+ if (absence != null) {
+ return absence;
+ }
+
+ StringBundler msg = new StringBundler(8);
+
+ msg.append(_NO_SUCH_ENTITY_WITH_KEY);
+
+ msg.append("startDate=");
+ msg.append(startDate);
+
+ msg.append(", endDate=");
+ msg.append(endDate);
+
+ msg.append(", subClassId=");
+ msg.append(subClassId);
+
+ msg.append(StringPool.CLOSE_CURLY_BRACE);
+
+ throw new NoSuchAbsenceException(msg.toString());
+ }
+
+ /**
+ * Returns the last absence in the ordered set where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the last matching absence, or <code>null</code> if a matching absence could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence fetchBystartDate_endDate_subClassId_Last(Date startDate,
+ Date endDate, long subClassId, OrderByComparator orderByComparator)
+ throws SystemException {
+ int count = countBystartDate_endDate_subClassId(startDate, endDate,
+ subClassId);
+
+ List<Absence> list = findBystartDate_endDate_subClassId(startDate,
+ endDate, subClassId, count - 1, count, orderByComparator);
+
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the absences before and after the current absence in the ordered set where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * @param absenceId the primary key of the current absence
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
+ * @return the previous, current, and next absence
+ * @throws com.pentila.entSavoie.gestionVieScolaire.NoSuchAbsenceException if a absence with the primary key could not be found
+ * @throws SystemException if a system exception occurred
+ */
+ public Absence[] findBystartDate_endDate_subClassId_PrevAndNext(
+ long absenceId, Date startDate, Date endDate, long subClassId,
+ OrderByComparator orderByComparator)
+ throws NoSuchAbsenceException, SystemException {
+ Absence absence = findByPrimaryKey(absenceId);
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Absence[] array = new AbsenceImpl[3];
+
+ array[0] = getBystartDate_endDate_subClassId_PrevAndNext(session,
+ absence, startDate, endDate, subClassId, orderByComparator,
+ true);
+
+ array[1] = absence;
+
+ array[2] = getBystartDate_endDate_subClassId_PrevAndNext(session,
+ absence, startDate, endDate, subClassId, orderByComparator,
+ false);
+
+ return array;
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ closeSession(session);
+ }
+ }
+
+ protected Absence getBystartDate_endDate_subClassId_PrevAndNext(
+ Session session, Absence absence, Date startDate, Date endDate,
+ long subClassId, 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_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_SUBCLASSID_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);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ qPos.add(subClassId);
+
+ if (orderByComparator != null) {
+ Object[] values = orderByComparator.getOrderByConditionValues(absence);
+
+ for (Object value : values) {
+ qPos.add(value);
+ }
+ }
+
+ List<Absence> list = q.list();
+
+ if (list.size() == 2) {
+ return list.get(1);
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns all the absences.
+ *
+ * @return the absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findAll() throws SystemException {
+ return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
+ }
+
+ /**
+ * Returns a range of all the absences.
+ *
+ * <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 absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @return the range of absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> findAll(int start, int end) throws SystemException {
+ return findAll(start, end, null);
+ }
+
+ /**
+ * Returns an ordered range of all the absences.
+ *
+ * <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 absences
+ * @param end the upper bound of the range of absences (not inclusive)
+ * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
+ * @return the ordered range of absences
+ * @throws SystemException if a system exception occurred
+ */
+ public List<Absence> 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<Absence> list = (List<Absence>)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_ABSENCE);
+
+ appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
+ orderByComparator);
+
+ sql = query.toString();
+ }
+ else {
+ sql = _SQL_SELECT_ABSENCE;
+ }
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ if (orderByComparator == null) {
+ list = (List<Absence>)QueryUtil.list(q, getDialect(),
+ start, end, false);
+
+ Collections.sort(list);
+ }
+ else {
+ list = (List<Absence>)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 absences where etabId = ? from the database.
+ *
+ * @param etabId the etab ID
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeByetabId(long etabId) throws SystemException {
+ for (Absence absence : findByetabId(etabId)) {
+ remove(absence);
+ }
+ }
+
+ /**
+ * Removes all the absences where teacherId = ? from the database.
+ *
+ * @param teacherId the teacher ID
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeByteacherId(long teacherId) throws SystemException {
+ for (Absence absence : findByteacherId(teacherId)) {
+ remove(absence);
+ }
+ }
+
+ /**
+ * Removes all the absences where startDate = ? and endDate = ? and teacherId = ? from the database.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeBystartDate_endDate_teacherId(Date startDate,
+ Date endDate, long teacherId) throws SystemException {
+ for (Absence absence : findBystartDate_endDate_teacherId(startDate,
+ endDate, teacherId)) {
+ remove(absence);
+ }
+ }
+
+ /**
+ * Removes all the absences where startDate = ? and endDate = ? and groupId = ? from the database.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeBystartDate_endDate_groupId(Date startDate, Date endDate,
+ long groupId) throws SystemException {
+ for (Absence absence : findBystartDate_endDate_groupId(startDate,
+ endDate, groupId)) {
+ remove(absence);
+ }
+ }
+
+ /**
+ * Removes all the absences where startDate = ? and endDate = ? and subClassId = ? from the database.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeBystartDate_endDate_subClassId(Date startDate,
+ Date endDate, long subClassId) throws SystemException {
+ for (Absence absence : findBystartDate_endDate_subClassId(startDate,
+ endDate, subClassId)) {
+ remove(absence);
+ }
+ }
+
+ /**
+ * Removes all the absences from the database.
+ *
+ * @throws SystemException if a system exception occurred
+ */
+ public void removeAll() throws SystemException {
+ for (Absence absence : findAll()) {
+ remove(absence);
+ }
+ }
+
+ /**
+ * Returns the number of absences where etabId = ?.
+ *
+ * @param etabId the etab ID
+ * @return the number of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public int countByetabId(long etabId) throws SystemException {
+ Object[] finderArgs = new Object[] { etabId };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_ETABID,
+ finderArgs, this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(2);
+
+ query.append(_SQL_COUNT_ABSENCE_WHERE);
+
+ query.append(_FINDER_COLUMN_ETABID_ETABID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(etabId);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_ETABID,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns the number of absences where teacherId = ?.
+ *
+ * @param teacherId the teacher ID
+ * @return the number of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public int countByteacherId(long teacherId) throws SystemException {
+ Object[] finderArgs = new Object[] { teacherId };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_TEACHERID,
+ finderArgs, this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(2);
+
+ query.append(_SQL_COUNT_ABSENCE_WHERE);
+
+ query.append(_FINDER_COLUMN_TEACHERID_TEACHERID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ qPos.add(teacherId);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_TEACHERID,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns the number of absences where startDate = ? and endDate = ? and teacherId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param teacherId the teacher ID
+ * @return the number of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public int countBystartDate_endDate_teacherId(Date startDate, Date endDate,
+ long teacherId) throws SystemException {
+ Object[] finderArgs = new Object[] { startDate, endDate, teacherId };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_TEACHERID,
+ finderArgs, this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(4);
+
+ query.append(_SQL_COUNT_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_TEACHERID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ qPos.add(teacherId);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_TEACHERID,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns the number of absences where startDate = ? and endDate = ? and groupId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param groupId the group ID
+ * @return the number of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public int countBystartDate_endDate_groupId(Date startDate, Date endDate,
+ long groupId) throws SystemException {
+ Object[] finderArgs = new Object[] { startDate, endDate, groupId };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_GROUPID,
+ finderArgs, this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(4);
+
+ query.append(_SQL_COUNT_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_GROUPID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ 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_STARTDATE_ENDDATE_GROUPID,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns the number of absences where startDate = ? and endDate = ? and subClassId = ?.
+ *
+ * @param startDate the start date
+ * @param endDate the end date
+ * @param subClassId the sub class ID
+ * @return the number of matching absences
+ * @throws SystemException if a system exception occurred
+ */
+ public int countBystartDate_endDate_subClassId(Date startDate,
+ Date endDate, long subClassId) throws SystemException {
+ Object[] finderArgs = new Object[] { startDate, endDate, subClassId };
+
+ Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_SUBCLASSID,
+ finderArgs, this);
+
+ if (count == null) {
+ StringBundler query = new StringBundler(4);
+
+ query.append(_SQL_COUNT_ABSENCE_WHERE);
+
+ if (startDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_STARTDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_STARTDATE_2);
+ }
+
+ if (endDate == null) {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_ENDDATE_1);
+ }
+ else {
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_ENDDATE_2);
+ }
+
+ query.append(_FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_SUBCLASSID_2);
+
+ String sql = query.toString();
+
+ Session session = null;
+
+ try {
+ session = openSession();
+
+ Query q = session.createQuery(sql);
+
+ QueryPos qPos = QueryPos.getInstance(q);
+
+ if (startDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(startDate));
+ }
+
+ if (endDate != null) {
+ qPos.add(CalendarUtil.getTimestamp(endDate));
+ }
+
+ qPos.add(subClassId);
+
+ count = (Long)q.uniqueResult();
+ }
+ catch (Exception e) {
+ throw processException(e);
+ }
+ finally {
+ if (count == null) {
+ count = Long.valueOf(0);
+ }
+
+ FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_STARTDATE_ENDDATE_SUBCLASSID,
+ finderArgs, count);
+
+ closeSession(session);
+ }
+ }
+
+ return count.intValue();
+ }
+
+ /**
+ * Returns the number of absences.
+ *
+ * @return the number of absences
+ * @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_ABSENCE);
+
+ 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();
+ }
+
+ /**
+ * Initializes the absence persistence.
+ */
+ public void afterPropertiesSet() {
+ String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
+ com.liferay.util.service.ServiceProps.get(
+ "value.object.listener.com.pentila.entSavoie.gestionVieScolaire.model.Absence")));
+
+ if (listenerClassNames.length > 0) {
+ try {
+ List<ModelListener<Absence>> listenersList = new ArrayList<ModelListener<Absence>>();
+
+ for (String listenerClassName : listenerClassNames) {
+ listenersList.add((ModelListener<Absence>)InstanceFactory.newInstance(
+ PortletClassLoaderUtil.getClassLoader(),
+ listenerClassName, (Class<?>[])null, (Object[])null));
+ }
+
+ listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
+ }
+ catch (Exception e) {
+ _log.error(e);
+ }
+ }
+ }
+
+ public void destroy() {
+ EntityCacheUtil.removeCache(AbsenceImpl.class.getName());
+ FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
+ FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
+ }
+
+ @BeanReference(type = AbsencePersistence.class)
+ protected AbsencePersistence absencePersistence;
+ @BeanReference(type = AbsencesBlogEntryMappingPersistence.class)
+ protected AbsencesBlogEntryMappingPersistence absencesBlogEntryMappingPersistence;
+ @BeanReference(type = SynchroConfigPersistence.class)
+ protected SynchroConfigPersistence synchroConfigPersistence;
+ @BeanReference(type = SynchroInstancePersistence.class)
+ protected SynchroInstancePersistence synchroInstancePersistence;
+ @BeanReference(type = UserMappingPersistence.class)
+ protected UserMappingPersistence userMappingPersistence;
+ @BeanReference(type = ResourcePersistence.class)
+ protected ResourcePersistence resourcePersistence;
+ @BeanReference(type = UserPersistence.class)
+ protected UserPersistence userPersistence;
+ private static final String _SQL_SELECT_ABSENCE = "SELECT absence FROM Absence absence";
+ private static final String _SQL_SELECT_ABSENCE_WHERE = "SELECT absence FROM Absence absence WHERE ";
+ private static final String _SQL_COUNT_ABSENCE = "SELECT COUNT(absence) FROM Absence absence";
+ private static final String _SQL_COUNT_ABSENCE_WHERE = "SELECT COUNT(absence) FROM Absence absence WHERE ";
+ private static final String _FINDER_COLUMN_ETABID_ETABID_2 = "absence.etabId = ?";
+ private static final String _FINDER_COLUMN_TEACHERID_TEACHERID_2 = "absence.teacherId = ?";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_STARTDATE_1 =
+ "absence.startDate IS NULL AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_STARTDATE_2 =
+ "absence.startDate = ? AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_ENDDATE_1 =
+ "absence.endDate IS NULL AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_ENDDATE_2 =
+ "absence.endDate = ? AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_TEACHERID_TEACHERID_2 =
+ "absence.teacherId = ?";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_STARTDATE_1 =
+ "absence.startDate IS NULL AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_STARTDATE_2 =
+ "absence.startDate = ? AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_ENDDATE_1 =
+ "absence.endDate IS NULL AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_ENDDATE_2 =
+ "absence.endDate = ? AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_GROUPID_GROUPID_2 =
+ "absence.groupId = ?";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_STARTDATE_1 =
+ "absence.startDate IS NULL AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_STARTDATE_2 =
+ "absence.startDate = ? AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_ENDDATE_1 =
+ "absence.endDate IS NULL AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_ENDDATE_2 =
+ "absence.endDate = ? AND ";
+ private static final String _FINDER_COLUMN_STARTDATE_ENDDATE_SUBCLASSID_SUBCLASSID_2 =
+ "absence.subClassId = ?";
+ private static final String _ORDER_BY_ENTITY_ALIAS = "absence.";
+ private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Absence exists with the primary key ";
+ private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Absence 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(AbsencePersistenceImpl.class);
+ private static Absence _nullAbsence = new AbsenceImpl() {
+ @Override
+ public Object clone() {
+ return this;
+ }
+
+ @Override
+ public CacheModel<Absence> toCacheModel() {
+ return _nullAbsenceCacheModel;
+ }
+ };
+
+ private static CacheModel<Absence> _nullAbsenceCacheModel = new CacheModel<Absence>() {
+ public Absence toEntityModel() {
+ return _nullAbsence;
+ }
+ };
+}
\ No newline at end of file