|
|
@ -19,6 +19,7 @@ import com.liferay.portal.kernel.dao.orm.EntityCacheUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.FinderCacheUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.FinderCacheUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.FinderPath; |
|
|
|
import com.liferay.portal.kernel.dao.orm.FinderPath; |
|
|
|
import com.liferay.portal.kernel.dao.orm.Query; |
|
|
|
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.QueryUtil; |
|
|
|
import com.liferay.portal.kernel.dao.orm.Session; |
|
|
|
import com.liferay.portal.kernel.dao.orm.Session; |
|
|
|
import com.liferay.portal.kernel.exception.SystemException; |
|
|
|
import com.liferay.portal.kernel.exception.SystemException; |
|
|
@ -31,6 +32,7 @@ import com.liferay.portal.kernel.util.PropsKeys; |
|
|
|
import com.liferay.portal.kernel.util.PropsUtil; |
|
|
|
import com.liferay.portal.kernel.util.PropsUtil; |
|
|
|
import com.liferay.portal.kernel.util.SetUtil; |
|
|
|
import com.liferay.portal.kernel.util.SetUtil; |
|
|
|
import com.liferay.portal.kernel.util.StringBundler; |
|
|
|
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.StringUtil; |
|
|
|
import com.liferay.portal.kernel.util.UnmodifiableList; |
|
|
|
import com.liferay.portal.kernel.util.UnmodifiableList; |
|
|
|
import com.liferay.portal.model.CacheModel; |
|
|
|
import com.liferay.portal.model.CacheModel; |
|
|
@ -85,6 +87,506 @@ public class ScheduledActionsPersistenceImpl extends BasePersistenceImpl<Schedul |
|
|
|
public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ScheduledActionsModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ScheduledActionsModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
ScheduledActionsModelImpl.FINDER_CACHE_ENABLED, Long.class, |
|
|
|
ScheduledActionsModelImpl.FINDER_CACHE_ENABLED, Long.class, |
|
|
|
FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]); |
|
|
|
FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]); |
|
|
|
|
|
|
|
public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_INTPRATICAID = |
|
|
|
|
|
|
|
new FinderPath(ScheduledActionsModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
|
|
|
|
ScheduledActionsModelImpl.FINDER_CACHE_ENABLED, |
|
|
|
|
|
|
|
ScheduledActionsImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, |
|
|
|
|
|
|
|
"findByIntPraticaId", |
|
|
|
|
|
|
|
new String[] { |
|
|
|
|
|
|
|
Long.class.getName(), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer.class.getName(), Integer.class.getName(), |
|
|
|
|
|
|
|
OrderByComparator.class.getName() |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_INTPRATICAID = |
|
|
|
|
|
|
|
new FinderPath(ScheduledActionsModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
|
|
|
|
ScheduledActionsModelImpl.FINDER_CACHE_ENABLED, |
|
|
|
|
|
|
|
ScheduledActionsImpl.class, |
|
|
|
|
|
|
|
FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByIntPraticaId", |
|
|
|
|
|
|
|
new String[] { Long.class.getName() }, |
|
|
|
|
|
|
|
ScheduledActionsModelImpl.INTPRATICAID_COLUMN_BITMASK); |
|
|
|
|
|
|
|
public static final FinderPath FINDER_PATH_COUNT_BY_INTPRATICAID = new FinderPath(ScheduledActionsModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
|
|
|
|
ScheduledActionsModelImpl.FINDER_CACHE_ENABLED, Long.class, |
|
|
|
|
|
|
|
FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByIntPraticaId", |
|
|
|
|
|
|
|
new String[] { Long.class.getName() }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns all the scheduled actionses where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @return the matching scheduled actionses |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<ScheduledActions> findByIntPraticaId(long intPraticaId) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
return findByIntPraticaId(intPraticaId, QueryUtil.ALL_POS, |
|
|
|
|
|
|
|
QueryUtil.ALL_POS, null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns a range of all the scheduled actionses where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* <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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link portos.nextmind.model.impl.ScheduledActionsModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. |
|
|
|
|
|
|
|
* </p> |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @param start the lower bound of the range of scheduled actionses |
|
|
|
|
|
|
|
* @param end the upper bound of the range of scheduled actionses (not inclusive) |
|
|
|
|
|
|
|
* @return the range of matching scheduled actionses |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<ScheduledActions> findByIntPraticaId(long intPraticaId, |
|
|
|
|
|
|
|
int start, int end) throws SystemException { |
|
|
|
|
|
|
|
return findByIntPraticaId(intPraticaId, start, end, null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns an ordered range of all the scheduled actionses where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* <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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link portos.nextmind.model.impl.ScheduledActionsModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. |
|
|
|
|
|
|
|
* </p> |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @param start the lower bound of the range of scheduled actionses |
|
|
|
|
|
|
|
* @param end the upper bound of the range of scheduled actionses (not inclusive) |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the ordered range of matching scheduled actionses |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<ScheduledActions> findByIntPraticaId(long intPraticaId, |
|
|
|
|
|
|
|
int start, int end, OrderByComparator orderByComparator) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
boolean pagination = true; |
|
|
|
|
|
|
|
FinderPath finderPath = null; |
|
|
|
|
|
|
|
Object[] finderArgs = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && |
|
|
|
|
|
|
|
(orderByComparator == null)) { |
|
|
|
|
|
|
|
pagination = false; |
|
|
|
|
|
|
|
finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_INTPRATICAID; |
|
|
|
|
|
|
|
finderArgs = new Object[] { intPraticaId }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_INTPRATICAID; |
|
|
|
|
|
|
|
finderArgs = new Object[] { |
|
|
|
|
|
|
|
intPraticaId, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
start, end, orderByComparator |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ScheduledActions> list = (List<ScheduledActions>)FinderCacheUtil.getResult(finderPath, |
|
|
|
|
|
|
|
finderArgs, this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((list != null) && !list.isEmpty()) { |
|
|
|
|
|
|
|
for (ScheduledActions scheduledActions : list) { |
|
|
|
|
|
|
|
if ((intPraticaId != scheduledActions.getIntPraticaId())) { |
|
|
|
|
|
|
|
list = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (list == null) { |
|
|
|
|
|
|
|
StringBundler query = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (orderByComparator != null) { |
|
|
|
|
|
|
|
query = new StringBundler(3 + |
|
|
|
|
|
|
|
(orderByComparator.getOrderByFields().length * 3)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
query = new StringBundler(3); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.append(_SQL_SELECT_SCHEDULEDACTIONS_WHERE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.append(_FINDER_COLUMN_INTPRATICAID_INTPRATICAID_2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (orderByComparator != null) { |
|
|
|
|
|
|
|
appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, |
|
|
|
|
|
|
|
orderByComparator); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
if (pagination) { |
|
|
|
|
|
|
|
query.append(ScheduledActionsModelImpl.ORDER_BY_JPQL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String sql = query.toString(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Session session = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
session = openSession(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Query q = session.createQuery(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryPos qPos = QueryPos.getInstance(q); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qPos.add(intPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!pagination) { |
|
|
|
|
|
|
|
list = (List<ScheduledActions>)QueryUtil.list(q, |
|
|
|
|
|
|
|
getDialect(), start, end, false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Collections.sort(list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list = new UnmodifiableList<ScheduledActions>(list); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
list = (List<ScheduledActions>)QueryUtil.list(q, |
|
|
|
|
|
|
|
getDialect(), start, end); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cacheResult(list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FinderCacheUtil.putResult(finderPath, finderArgs, list); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception e) { |
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(finderPath, finderArgs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw processException(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
finally { |
|
|
|
|
|
|
|
closeSession(session); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return list; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the first scheduled actions in the ordered set where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the first matching scheduled actions |
|
|
|
|
|
|
|
* @throws portos.nextmind.NoSuchScheduledActionsException if a matching scheduled actions could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public ScheduledActions findByIntPraticaId_First(long intPraticaId, |
|
|
|
|
|
|
|
OrderByComparator orderByComparator) |
|
|
|
|
|
|
|
throws NoSuchScheduledActionsException, SystemException { |
|
|
|
|
|
|
|
ScheduledActions scheduledActions = fetchByIntPraticaId_First(intPraticaId, |
|
|
|
|
|
|
|
orderByComparator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (scheduledActions != null) { |
|
|
|
|
|
|
|
return scheduledActions; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBundler msg = new StringBundler(4); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append(_NO_SUCH_ENTITY_WITH_KEY); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append("intPraticaId="); |
|
|
|
|
|
|
|
msg.append(intPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append(StringPool.CLOSE_CURLY_BRACE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw new NoSuchScheduledActionsException(msg.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the first scheduled actions in the ordered set where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the first matching scheduled actions, or <code>null</code> if a matching scheduled actions could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public ScheduledActions fetchByIntPraticaId_First(long intPraticaId, |
|
|
|
|
|
|
|
OrderByComparator orderByComparator) throws SystemException { |
|
|
|
|
|
|
|
List<ScheduledActions> list = findByIntPraticaId(intPraticaId, 0, 1, |
|
|
|
|
|
|
|
orderByComparator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
|
|
|
return list.get(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the last scheduled actions in the ordered set where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the last matching scheduled actions |
|
|
|
|
|
|
|
* @throws portos.nextmind.NoSuchScheduledActionsException if a matching scheduled actions could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public ScheduledActions findByIntPraticaId_Last(long intPraticaId, |
|
|
|
|
|
|
|
OrderByComparator orderByComparator) |
|
|
|
|
|
|
|
throws NoSuchScheduledActionsException, SystemException { |
|
|
|
|
|
|
|
ScheduledActions scheduledActions = fetchByIntPraticaId_Last(intPraticaId, |
|
|
|
|
|
|
|
orderByComparator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (scheduledActions != null) { |
|
|
|
|
|
|
|
return scheduledActions; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBundler msg = new StringBundler(4); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append(_NO_SUCH_ENTITY_WITH_KEY); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append("intPraticaId="); |
|
|
|
|
|
|
|
msg.append(intPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append(StringPool.CLOSE_CURLY_BRACE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw new NoSuchScheduledActionsException(msg.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the last scheduled actions in the ordered set where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the last matching scheduled actions, or <code>null</code> if a matching scheduled actions could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public ScheduledActions fetchByIntPraticaId_Last(long intPraticaId, |
|
|
|
|
|
|
|
OrderByComparator orderByComparator) throws SystemException { |
|
|
|
|
|
|
|
int count = countByIntPraticaId(intPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (count == 0) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ScheduledActions> list = findByIntPraticaId(intPraticaId, |
|
|
|
|
|
|
|
count - 1, count, orderByComparator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
|
|
|
return list.get(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the scheduled actionses before and after the current scheduled actions in the ordered set where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param shop_id the primary key of the current scheduled actions |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the previous, current, and next scheduled actions |
|
|
|
|
|
|
|
* @throws portos.nextmind.NoSuchScheduledActionsException if a scheduled actions with the primary key could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public ScheduledActions[] findByIntPraticaId_PrevAndNext(long shop_id, |
|
|
|
|
|
|
|
long intPraticaId, OrderByComparator orderByComparator) |
|
|
|
|
|
|
|
throws NoSuchScheduledActionsException, SystemException { |
|
|
|
|
|
|
|
ScheduledActions scheduledActions = findByPrimaryKey(shop_id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Session session = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
session = openSession(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScheduledActions[] array = new ScheduledActionsImpl[3]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
array[0] = getByIntPraticaId_PrevAndNext(session, scheduledActions, |
|
|
|
|
|
|
|
intPraticaId, orderByComparator, true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
array[1] = scheduledActions; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
array[2] = getByIntPraticaId_PrevAndNext(session, scheduledActions, |
|
|
|
|
|
|
|
intPraticaId, orderByComparator, false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return array; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception e) { |
|
|
|
|
|
|
|
throw processException(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
finally { |
|
|
|
|
|
|
|
closeSession(session); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ScheduledActions getByIntPraticaId_PrevAndNext(Session session, |
|
|
|
|
|
|
|
ScheduledActions scheduledActions, long intPraticaId, |
|
|
|
|
|
|
|
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_SCHEDULEDACTIONS_WHERE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.append(_FINDER_COLUMN_INTPRATICAID_INTPRATICAID_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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
query.append(ScheduledActionsModelImpl.ORDER_BY_JPQL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String sql = query.toString(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Query q = session.createQuery(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
q.setFirstResult(0); |
|
|
|
|
|
|
|
q.setMaxResults(2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryPos qPos = QueryPos.getInstance(q); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qPos.add(intPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (orderByComparator != null) { |
|
|
|
|
|
|
|
Object[] values = orderByComparator.getOrderByConditionValues(scheduledActions); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Object value : values) { |
|
|
|
|
|
|
|
qPos.add(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ScheduledActions> list = q.list(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (list.size() == 2) { |
|
|
|
|
|
|
|
return list.get(1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Removes all the scheduled actionses where intPraticaId = ? from the database. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void removeByIntPraticaId(long intPraticaId) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
for (ScheduledActions scheduledActions : findByIntPraticaId( |
|
|
|
|
|
|
|
intPraticaId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { |
|
|
|
|
|
|
|
remove(scheduledActions); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the number of scheduled actionses where intPraticaId = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param intPraticaId the int pratica ID |
|
|
|
|
|
|
|
* @return the number of matching scheduled actionses |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int countByIntPraticaId(long intPraticaId) throws SystemException { |
|
|
|
|
|
|
|
FinderPath finderPath = FINDER_PATH_COUNT_BY_INTPRATICAID; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object[] finderArgs = new Object[] { intPraticaId }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs, |
|
|
|
|
|
|
|
this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (count == null) { |
|
|
|
|
|
|
|
StringBundler query = new StringBundler(2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.append(_SQL_COUNT_SCHEDULEDACTIONS_WHERE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.append(_FINDER_COLUMN_INTPRATICAID_INTPRATICAID_2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String sql = query.toString(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Session session = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
session = openSession(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Query q = session.createQuery(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryPos qPos = QueryPos.getInstance(q); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qPos.add(intPraticaId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
count = (Long)q.uniqueResult(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FinderCacheUtil.putResult(finderPath, finderArgs, count); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception e) { |
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(finderPath, finderArgs); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw processException(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
finally { |
|
|
|
|
|
|
|
closeSession(session); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return count.intValue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String _FINDER_COLUMN_INTPRATICAID_INTPRATICAID_2 = "scheduledActions.intPraticaId = ?"; |
|
|
|
|
|
|
|
|
|
|
|
public ScheduledActionsPersistenceImpl() { |
|
|
|
public ScheduledActionsPersistenceImpl() { |
|
|
|
setModelClass(ScheduledActions.class); |
|
|
|
setModelClass(ScheduledActions.class); |
|
|
@ -283,6 +785,8 @@ public class ScheduledActionsPersistenceImpl extends BasePersistenceImpl<Schedul |
|
|
|
|
|
|
|
|
|
|
|
boolean isNew = scheduledActions.isNew(); |
|
|
|
boolean isNew = scheduledActions.isNew(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ScheduledActionsModelImpl scheduledActionsModelImpl = (ScheduledActionsModelImpl)scheduledActions; |
|
|
|
|
|
|
|
|
|
|
|
Session session = null; |
|
|
|
Session session = null; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
@ -306,10 +810,31 @@ public class ScheduledActionsPersistenceImpl extends BasePersistenceImpl<Schedul |
|
|
|
|
|
|
|
|
|
|
|
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); |
|
|
|
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); |
|
|
|
|
|
|
|
|
|
|
|
if (isNew) { |
|
|
|
if (isNew || !ScheduledActionsModelImpl.COLUMN_BITMASK_ENABLED) { |
|
|
|
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); |
|
|
|
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
if ((scheduledActionsModelImpl.getColumnBitmask() & |
|
|
|
|
|
|
|
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_INTPRATICAID.getColumnBitmask()) != 0) { |
|
|
|
|
|
|
|
Object[] args = new Object[] { |
|
|
|
|
|
|
|
scheduledActionsModelImpl.getOriginalIntPraticaId() |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_INTPRATICAID, |
|
|
|
|
|
|
|
args); |
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_INTPRATICAID, |
|
|
|
|
|
|
|
args); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
args = new Object[] { scheduledActionsModelImpl.getIntPraticaId() }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_INTPRATICAID, |
|
|
|
|
|
|
|
args); |
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_INTPRATICAID, |
|
|
|
|
|
|
|
args); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
EntityCacheUtil.putResult(ScheduledActionsModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
EntityCacheUtil.putResult(ScheduledActionsModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
ScheduledActionsImpl.class, scheduledActions.getPrimaryKey(), |
|
|
|
ScheduledActionsImpl.class, scheduledActions.getPrimaryKey(), |
|
|
|
scheduledActions); |
|
|
|
scheduledActions); |
|
|
@ -333,6 +858,7 @@ public class ScheduledActionsPersistenceImpl extends BasePersistenceImpl<Schedul |
|
|
|
scheduledActionsImpl.setHeaders(scheduledActions.getHeaders()); |
|
|
|
scheduledActionsImpl.setHeaders(scheduledActions.getHeaders()); |
|
|
|
scheduledActionsImpl.setErrorLog(scheduledActions.getErrorLog()); |
|
|
|
scheduledActionsImpl.setErrorLog(scheduledActions.getErrorLog()); |
|
|
|
scheduledActionsImpl.setErrorFlag(scheduledActions.isErrorFlag()); |
|
|
|
scheduledActionsImpl.setErrorFlag(scheduledActions.isErrorFlag()); |
|
|
|
|
|
|
|
scheduledActionsImpl.setIntPraticaId(scheduledActions.getIntPraticaId()); |
|
|
|
|
|
|
|
|
|
|
|
return scheduledActionsImpl; |
|
|
|
return scheduledActionsImpl; |
|
|
|
} |
|
|
|
} |
|
|
@ -649,14 +1175,17 @@ public class ScheduledActionsPersistenceImpl extends BasePersistenceImpl<Schedul |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final String _SQL_SELECT_SCHEDULEDACTIONS = "SELECT scheduledActions FROM ScheduledActions scheduledActions"; |
|
|
|
private static final String _SQL_SELECT_SCHEDULEDACTIONS = "SELECT scheduledActions FROM ScheduledActions scheduledActions"; |
|
|
|
|
|
|
|
private static final String _SQL_SELECT_SCHEDULEDACTIONS_WHERE = "SELECT scheduledActions FROM ScheduledActions scheduledActions WHERE "; |
|
|
|
private static final String _SQL_COUNT_SCHEDULEDACTIONS = "SELECT COUNT(scheduledActions) FROM ScheduledActions scheduledActions"; |
|
|
|
private static final String _SQL_COUNT_SCHEDULEDACTIONS = "SELECT COUNT(scheduledActions) FROM ScheduledActions scheduledActions"; |
|
|
|
|
|
|
|
private static final String _SQL_COUNT_SCHEDULEDACTIONS_WHERE = "SELECT COUNT(scheduledActions) FROM ScheduledActions scheduledActions WHERE "; |
|
|
|
private static final String _ORDER_BY_ENTITY_ALIAS = "scheduledActions."; |
|
|
|
private static final String _ORDER_BY_ENTITY_ALIAS = "scheduledActions."; |
|
|
|
private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ScheduledActions exists with the primary key "; |
|
|
|
private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ScheduledActions exists with the primary key "; |
|
|
|
|
|
|
|
private static final String _NO_SUCH_ENTITY_WITH_KEY = "No ScheduledActions exists with the key {"; |
|
|
|
private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get( |
|
|
|
private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get( |
|
|
|
PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE)); |
|
|
|
PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE)); |
|
|
|
private static Log _log = LogFactoryUtil.getLog(ScheduledActionsPersistenceImpl.class); |
|
|
|
private static Log _log = LogFactoryUtil.getLog(ScheduledActionsPersistenceImpl.class); |
|
|
|
private static Set<String> _badColumnNames = SetUtil.fromArray(new String[] { |
|
|
|
private static Set<String> _badColumnNames = SetUtil.fromArray(new String[] { |
|
|
|
"requestAction", "errorLog", "errorFlag" |
|
|
|
"requestAction", "errorLog", "errorFlag", "intPraticaId" |
|
|
|
}); |
|
|
|
}); |
|
|
|
private static ScheduledActions _nullScheduledActions = new ScheduledActionsImpl() { |
|
|
|
private static ScheduledActions _nullScheduledActions = new ScheduledActionsImpl() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|