|
|
@ -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; |
|
|
@ -83,6 +85,342 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello> |
|
|
|
public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
SportelloModelImpl.FINDER_CACHE_ENABLED, Long.class, |
|
|
|
SportelloModelImpl.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_ID = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
|
|
|
|
SportelloModelImpl.FINDER_CACHE_ENABLED, SportelloImpl.class, |
|
|
|
|
|
|
|
FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findById", |
|
|
|
|
|
|
|
new String[] { |
|
|
|
|
|
|
|
Long.class.getName(), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer.class.getName(), Integer.class.getName(), |
|
|
|
|
|
|
|
OrderByComparator.class.getName() |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ID = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
|
|
|
|
SportelloModelImpl.FINDER_CACHE_ENABLED, SportelloImpl.class, |
|
|
|
|
|
|
|
FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findById", |
|
|
|
|
|
|
|
new String[] { Long.class.getName() }, |
|
|
|
|
|
|
|
SportelloModelImpl.ID_COLUMN_BITMASK); |
|
|
|
|
|
|
|
public static final FinderPath FINDER_PATH_COUNT_BY_ID = new FinderPath(SportelloModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
|
|
|
|
SportelloModelImpl.FINDER_CACHE_ENABLED, Long.class, |
|
|
|
|
|
|
|
FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countById", |
|
|
|
|
|
|
|
new String[] { Long.class.getName() }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns all the sportellos where id = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id the ID |
|
|
|
|
|
|
|
* @return the matching sportellos |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<Sportello> findById(long id) throws SystemException { |
|
|
|
|
|
|
|
return findById(id, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns a range of all the sportellos where id = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* <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.SportelloModelImpl}. 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 id the ID |
|
|
|
|
|
|
|
* @param start the lower bound of the range of sportellos |
|
|
|
|
|
|
|
* @param end the upper bound of the range of sportellos (not inclusive) |
|
|
|
|
|
|
|
* @return the range of matching sportellos |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<Sportello> findById(long id, int start, int end) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
return findById(id, start, end, null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns an ordered range of all the sportellos where id = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* <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.SportelloModelImpl}. 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 id the ID |
|
|
|
|
|
|
|
* @param start the lower bound of the range of sportellos |
|
|
|
|
|
|
|
* @param end the upper bound of the range of sportellos (not inclusive) |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the results by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the ordered range of matching sportellos |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<Sportello> findById(long id, 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_ID; |
|
|
|
|
|
|
|
finderArgs = new Object[] { id }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_ID; |
|
|
|
|
|
|
|
finderArgs = new Object[] { id, start, end, orderByComparator }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Sportello> list = (List<Sportello>)FinderCacheUtil.getResult(finderPath, |
|
|
|
|
|
|
|
finderArgs, this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((list != null) && !list.isEmpty()) { |
|
|
|
|
|
|
|
for (Sportello sportello : list) { |
|
|
|
|
|
|
|
if ((id != sportello.getId())) { |
|
|
|
|
|
|
|
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_SPORTELLO_WHERE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.append(_FINDER_COLUMN_ID_ID_2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (orderByComparator != null) { |
|
|
|
|
|
|
|
appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, |
|
|
|
|
|
|
|
orderByComparator); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
if (pagination) { |
|
|
|
|
|
|
|
query.append(SportelloModelImpl.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(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!pagination) { |
|
|
|
|
|
|
|
list = (List<Sportello>)QueryUtil.list(q, getDialect(), |
|
|
|
|
|
|
|
start, end, false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Collections.sort(list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list = new UnmodifiableList<Sportello>(list); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
list = (List<Sportello>)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 sportello in the ordered set where id = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id the ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the first matching sportello |
|
|
|
|
|
|
|
* @throws portos.nextmind.NoSuchSportelloException if a matching sportello could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Sportello findById_First(long id, OrderByComparator orderByComparator) |
|
|
|
|
|
|
|
throws NoSuchSportelloException, SystemException { |
|
|
|
|
|
|
|
Sportello sportello = fetchById_First(id, orderByComparator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sportello != null) { |
|
|
|
|
|
|
|
return sportello; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBundler msg = new StringBundler(4); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append(_NO_SUCH_ENTITY_WITH_KEY); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append("id="); |
|
|
|
|
|
|
|
msg.append(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append(StringPool.CLOSE_CURLY_BRACE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw new NoSuchSportelloException(msg.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the first sportello in the ordered set where id = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id the ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the first matching sportello, or <code>null</code> if a matching sportello could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Sportello fetchById_First(long id, |
|
|
|
|
|
|
|
OrderByComparator orderByComparator) throws SystemException { |
|
|
|
|
|
|
|
List<Sportello> list = findById(id, 0, 1, orderByComparator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
|
|
|
return list.get(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the last sportello in the ordered set where id = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id the ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the last matching sportello |
|
|
|
|
|
|
|
* @throws portos.nextmind.NoSuchSportelloException if a matching sportello could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Sportello findById_Last(long id, OrderByComparator orderByComparator) |
|
|
|
|
|
|
|
throws NoSuchSportelloException, SystemException { |
|
|
|
|
|
|
|
Sportello sportello = fetchById_Last(id, orderByComparator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sportello != null) { |
|
|
|
|
|
|
|
return sportello; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBundler msg = new StringBundler(4); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append(_NO_SUCH_ENTITY_WITH_KEY); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append("id="); |
|
|
|
|
|
|
|
msg.append(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.append(StringPool.CLOSE_CURLY_BRACE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw new NoSuchSportelloException(msg.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the last sportello in the ordered set where id = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id the ID |
|
|
|
|
|
|
|
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>) |
|
|
|
|
|
|
|
* @return the last matching sportello, or <code>null</code> if a matching sportello could not be found |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Sportello fetchById_Last(long id, OrderByComparator orderByComparator) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
int count = countById(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (count == 0) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Sportello> list = findById(id, count - 1, count, orderByComparator); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
|
|
|
return list.get(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Removes all the sportellos where id = ? from the database. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id the ID |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void removeById(long id) throws SystemException { |
|
|
|
|
|
|
|
for (Sportello sportello : findById(id, QueryUtil.ALL_POS, |
|
|
|
|
|
|
|
QueryUtil.ALL_POS, null)) { |
|
|
|
|
|
|
|
remove(sportello); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the number of sportellos where id = ?. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param id the ID |
|
|
|
|
|
|
|
* @return the number of matching sportellos |
|
|
|
|
|
|
|
* @throws SystemException if a system exception occurred |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int countById(long id) throws SystemException { |
|
|
|
|
|
|
|
FinderPath finderPath = FINDER_PATH_COUNT_BY_ID; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object[] finderArgs = new Object[] { id }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs, |
|
|
|
|
|
|
|
this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (count == null) { |
|
|
|
|
|
|
|
StringBundler query = new StringBundler(2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.append(_SQL_COUNT_SPORTELLO_WHERE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.append(_FINDER_COLUMN_ID_ID_2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String sql = query.toString(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Session session = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
session = openSession(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Query q = session.createQuery(sql); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryPos qPos = QueryPos.getInstance(q); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qPos.add(id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_ID_ID_2 = "sportello.id = ?"; |
|
|
|
|
|
|
|
|
|
|
|
public SportelloPersistenceImpl() { |
|
|
|
public SportelloPersistenceImpl() { |
|
|
|
setModelClass(Sportello.class); |
|
|
|
setModelClass(Sportello.class); |
|
|
@ -278,6 +616,8 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello> |
|
|
|
|
|
|
|
|
|
|
|
boolean isNew = sportello.isNew(); |
|
|
|
boolean isNew = sportello.isNew(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SportelloModelImpl sportelloModelImpl = (SportelloModelImpl)sportello; |
|
|
|
|
|
|
|
|
|
|
|
Session session = null; |
|
|
|
Session session = null; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
@ -301,10 +641,27 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello> |
|
|
|
|
|
|
|
|
|
|
|
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); |
|
|
|
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); |
|
|
|
|
|
|
|
|
|
|
|
if (isNew) { |
|
|
|
if (isNew || !SportelloModelImpl.COLUMN_BITMASK_ENABLED) { |
|
|
|
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); |
|
|
|
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
if ((sportelloModelImpl.getColumnBitmask() & |
|
|
|
|
|
|
|
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ID.getColumnBitmask()) != 0) { |
|
|
|
|
|
|
|
Object[] args = new Object[] { sportelloModelImpl.getOriginalId() }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ID, args); |
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ID, |
|
|
|
|
|
|
|
args); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
args = new Object[] { sportelloModelImpl.getId() }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ID, args); |
|
|
|
|
|
|
|
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ID, |
|
|
|
|
|
|
|
args); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
EntityCacheUtil.putResult(SportelloModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
EntityCacheUtil.putResult(SportelloModelImpl.ENTITY_CACHE_ENABLED, |
|
|
|
SportelloImpl.class, sportello.getPrimaryKey(), sportello); |
|
|
|
SportelloImpl.class, sportello.getPrimaryKey(), sportello); |
|
|
|
|
|
|
|
|
|
|
@ -651,9 +1008,12 @@ public class SportelloPersistenceImpl extends BasePersistenceImpl<Sportello> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final String _SQL_SELECT_SPORTELLO = "SELECT sportello FROM Sportello sportello"; |
|
|
|
private static final String _SQL_SELECT_SPORTELLO = "SELECT sportello FROM Sportello sportello"; |
|
|
|
|
|
|
|
private static final String _SQL_SELECT_SPORTELLO_WHERE = "SELECT sportello FROM Sportello sportello WHERE "; |
|
|
|
private static final String _SQL_COUNT_SPORTELLO = "SELECT COUNT(sportello) FROM Sportello sportello"; |
|
|
|
private static final String _SQL_COUNT_SPORTELLO = "SELECT COUNT(sportello) FROM Sportello sportello"; |
|
|
|
|
|
|
|
private static final String _SQL_COUNT_SPORTELLO_WHERE = "SELECT COUNT(sportello) FROM Sportello sportello WHERE "; |
|
|
|
private static final String _ORDER_BY_ENTITY_ALIAS = "sportello."; |
|
|
|
private static final String _ORDER_BY_ENTITY_ALIAS = "sportello."; |
|
|
|
private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Sportello exists with the primary key "; |
|
|
|
private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Sportello exists with the primary key "; |
|
|
|
|
|
|
|
private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Sportello 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(SportelloPersistenceImpl.class); |
|
|
|
private static Log _log = LogFactoryUtil.getLog(SportelloPersistenceImpl.class); |
|
|
|