本文整理汇总了Java中com.liferay.portal.kernel.dao.orm.Session类的典型用法代码示例。如果您正苦于以下问题:Java Session类的具体用法?Java Session怎么用?Java Session使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Session类属于com.liferay.portal.kernel.dao.orm包,在下文中一共展示了Session类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeImpl
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
@Override
protected Concern removeImpl(Concern concern) throws SystemException {
concern = toUnwrappedModel(concern);
Session session = null;
try {
session = openSession();
BatchSessionUtil.delete(session, concern);
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
clearCache(concern);
return concern;
}
示例2: removeImpl
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
@Override
protected MultiMedia removeImpl(MultiMedia multiMedia)
throws SystemException {
multiMedia = toUnwrappedModel(multiMedia);
Session session = null;
try {
session = openSession();
BatchSessionUtil.delete(session, multiMedia);
} catch (Exception e) {
throw processException(e);
} finally {
closeSession(session);
}
clearCache(multiMedia);
return multiMedia;
}
示例3: removeImpl
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
@Override
protected SurveyResult removeImpl(SurveyResult surveyResult)
throws SystemException {
surveyResult = toUnwrappedModel(surveyResult);
Session session = null;
try {
session = openSession();
BatchSessionUtil.delete(session, surveyResult);
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
clearCache(surveyResult);
return surveyResult;
}
示例4: remove
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Removes the dict collection with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param primaryKey the primary key of the dict collection
* @return the dict collection that was removed
* @throws NoSuchDictCollectionException if a dict collection with the primary key could not be found
*/
@Override
public DictCollection remove(Serializable primaryKey)
throws NoSuchDictCollectionException {
Session session = null;
try {
session = openSession();
DictCollection dictCollection = (DictCollection)session.get(DictCollectionImpl.class,
primaryKey);
if (dictCollection == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchDictCollectionException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(dictCollection);
}
catch (NoSuchDictCollectionException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}
示例5: removeImpl
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
@Override
protected DictCollection removeImpl(DictCollection dictCollection) {
dictCollection = toUnwrappedModel(dictCollection);
Session session = null;
try {
session = openSession();
if (!session.contains(dictCollection)) {
dictCollection = (DictCollection)session.get(DictCollectionImpl.class,
dictCollection.getPrimaryKeyObj());
}
if (dictCollection != null) {
session.delete(dictCollection);
}
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
if (dictCollection != null) {
clearCache(dictCollection);
}
return dictCollection;
}
示例6: findByUuid_PrevAndNext
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Returns the dict collections before and after the current dict collection in the ordered set where uuid = ?.
*
* @param dictCollectionId the primary key of the current dict collection
* @param uuid the uuid
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next dict collection
* @throws NoSuchDictCollectionException if a dict collection with the primary key could not be found
*/
@Override
public DictCollection[] findByUuid_PrevAndNext(long dictCollectionId,
String uuid, OrderByComparator<DictCollection> orderByComparator)
throws NoSuchDictCollectionException {
DictCollection dictCollection = findByPrimaryKey(dictCollectionId);
Session session = null;
try {
session = openSession();
DictCollection[] array = new DictCollectionImpl[3];
array[0] = getByUuid_PrevAndNext(session, dictCollection, uuid,
orderByComparator, true);
array[1] = dictCollection;
array[2] = getByUuid_PrevAndNext(session, dictCollection, uuid,
orderByComparator, false);
return array;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}
示例7: findByUuid_C_PrevAndNext
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Returns the dict collections before and after the current dict collection in the ordered set where uuid = ? and companyId = ?.
*
* @param dictCollectionId the primary key of the current dict collection
* @param uuid the uuid
* @param companyId the company ID
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next dict collection
* @throws NoSuchDictCollectionException if a dict collection with the primary key could not be found
*/
@Override
public DictCollection[] findByUuid_C_PrevAndNext(long dictCollectionId,
String uuid, long companyId,
OrderByComparator<DictCollection> orderByComparator)
throws NoSuchDictCollectionException {
DictCollection dictCollection = findByPrimaryKey(dictCollectionId);
Session session = null;
try {
session = openSession();
DictCollection[] array = new DictCollectionImpl[3];
array[0] = getByUuid_C_PrevAndNext(session, dictCollection, uuid,
companyId, orderByComparator, true);
array[1] = dictCollection;
array[2] = getByUuid_C_PrevAndNext(session, dictCollection, uuid,
companyId, orderByComparator, false);
return array;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}
示例8: findByF_dictCollectionByGroup_PrevAndNext
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Returns the dict collections before and after the current dict collection in the ordered set where groupId = ?.
*
* @param dictCollectionId the primary key of the current dict collection
* @param groupId the group ID
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next dict collection
* @throws NoSuchDictCollectionException if a dict collection with the primary key could not be found
*/
@Override
public DictCollection[] findByF_dictCollectionByGroup_PrevAndNext(
long dictCollectionId, long groupId,
OrderByComparator<DictCollection> orderByComparator)
throws NoSuchDictCollectionException {
DictCollection dictCollection = findByPrimaryKey(dictCollectionId);
Session session = null;
try {
session = openSession();
DictCollection[] array = new DictCollectionImpl[3];
array[0] = getByF_dictCollectionByGroup_PrevAndNext(session,
dictCollection, groupId, orderByComparator, true);
array[1] = dictCollection;
array[2] = getByF_dictCollectionByGroup_PrevAndNext(session,
dictCollection, groupId, orderByComparator, false);
return array;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}
示例9: countAll
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Returns the number of dict collections.
*
* @return the number of dict collections
*/
@Override
public int countAll() {
Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
FINDER_ARGS_EMPTY, this);
if (count == null) {
Session session = null;
try {
session = openSession();
Query q = session.createQuery(_SQL_COUNT_DICTCOLLECTION);
count = (Long)q.uniqueResult();
finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
count);
}
catch (Exception e) {
finderCache.removeResult(FINDER_PATH_COUNT_ALL,
FINDER_ARGS_EMPTY);
throw processException(e);
}
finally {
closeSession(session);
}
}
return count.intValue();
}
示例10: findByUuid_PrevAndNext
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Returns the votings before and after the current voting in the ordered set where uuid = ?.
*
* @param votingId the primary key of the current voting
* @param uuid the uuid
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next voting
* @throws NoSuchVotingException if a voting with the primary key could not be found
*/
@Override
public Voting[] findByUuid_PrevAndNext(long votingId, String uuid,
OrderByComparator<Voting> orderByComparator)
throws NoSuchVotingException {
Voting voting = findByPrimaryKey(votingId);
Session session = null;
try {
session = openSession();
Voting[] array = new VotingImpl[3];
array[0] = getByUuid_PrevAndNext(session, voting, uuid,
orderByComparator, true);
array[1] = voting;
array[2] = getByUuid_PrevAndNext(session, voting, uuid,
orderByComparator, false);
return array;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}
示例11: findByUuid_C_PrevAndNext
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Returns the votings before and after the current voting in the ordered set where uuid = ? and companyId = ?.
*
* @param votingId the primary key of the current voting
* @param uuid the uuid
* @param companyId the company ID
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next voting
* @throws NoSuchVotingException if a voting with the primary key could not be found
*/
@Override
public Voting[] findByUuid_C_PrevAndNext(long votingId, String uuid,
long companyId, OrderByComparator<Voting> orderByComparator)
throws NoSuchVotingException {
Voting voting = findByPrimaryKey(votingId);
Session session = null;
try {
session = openSession();
Voting[] array = new VotingImpl[3];
array[0] = getByUuid_C_PrevAndNext(session, voting, uuid,
companyId, orderByComparator, true);
array[1] = voting;
array[2] = getByUuid_C_PrevAndNext(session, voting, uuid,
companyId, orderByComparator, false);
return array;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}
示例12: remove
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Removes the voting with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param primaryKey the primary key of the voting
* @return the voting that was removed
* @throws NoSuchVotingException if a voting with the primary key could not be found
*/
@Override
public Voting remove(Serializable primaryKey) throws NoSuchVotingException {
Session session = null;
try {
session = openSession();
Voting voting = (Voting)session.get(VotingImpl.class, primaryKey);
if (voting == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchVotingException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(voting);
}
catch (NoSuchVotingException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}
示例13: removeImpl
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
@Override
protected Voting removeImpl(Voting voting) {
voting = toUnwrappedModel(voting);
Session session = null;
try {
session = openSession();
if (!session.contains(voting)) {
voting = (Voting)session.get(VotingImpl.class,
voting.getPrimaryKeyObj());
}
if (voting != null) {
session.delete(voting);
}
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
if (voting != null) {
clearCache(voting);
}
return voting;
}
示例14: countAll
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Returns the number of votings.
*
* @return the number of votings
*/
@Override
public int countAll() {
Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
FINDER_ARGS_EMPTY, this);
if (count == null) {
Session session = null;
try {
session = openSession();
Query q = session.createQuery(_SQL_COUNT_VOTING);
count = (Long)q.uniqueResult();
finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
count);
}
catch (Exception e) {
finderCache.removeResult(FINDER_PATH_COUNT_ALL,
FINDER_ARGS_EMPTY);
throw processException(e);
}
finally {
closeSession(session);
}
}
return count.intValue();
}
示例15: findByUuid_PrevAndNext
import com.liferay.portal.kernel.dao.orm.Session; //导入依赖的package包/类
/**
* Returns the voting results before and after the current voting result in the ordered set where uuid = ?.
*
* @param votingResultId the primary key of the current voting result
* @param uuid the uuid
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the previous, current, and next voting result
* @throws NoSuchVotingResultException if a voting result with the primary key could not be found
*/
@Override
public VotingResult[] findByUuid_PrevAndNext(long votingResultId,
String uuid, OrderByComparator<VotingResult> orderByComparator)
throws NoSuchVotingResultException {
VotingResult votingResult = findByPrimaryKey(votingResultId);
Session session = null;
try {
session = openSession();
VotingResult[] array = new VotingResultImpl[3];
array[0] = getByUuid_PrevAndNext(session, votingResult, uuid,
orderByComparator, true);
array[1] = votingResult;
array[2] = getByUuid_PrevAndNext(session, votingResult, uuid,
orderByComparator, false);
return array;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
}