throws SystemException {
location = toUnwrappedModel(location);
boolean isNew = location.isNew();
LocationModelImpl locationModelImpl = (LocationModelImpl)location;
Session session = null;
try {
session = openSession();
if (location.isNew()) {
session.save(location);
location.setNew(false);
}
else {
session.merge(location);
}
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
if (isNew || !LocationModelImpl.COLUMN_BITMASK_ENABLED) {
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
}
else {
if ((locationModelImpl.getColumnBitmask() &
FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID.getColumnBitmask()) != 0) {
Object[] args = new Object[] {
locationModelImpl.getOriginalGroupId()
};
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_GROUPID, args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID,
args);
args = new Object[] { locationModelImpl.getGroupId() };
FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_GROUPID, args);
FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID,
args);
}