当前位置: 首页>>代码示例>>Java>>正文


Java Session.get方法代码示例

本文整理汇总了Java中com.liferay.portal.kernel.dao.orm.Session.get方法的典型用法代码示例。如果您正苦于以下问题:Java Session.get方法的具体用法?Java Session.get怎么用?Java Session.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portal.kernel.dao.orm.Session的用法示例。


在下文中一共展示了Session.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAppBigIconBlobModel

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public ApplicationAppBigIconBlobModel getAppBigIconBlobModel(
	Serializable primaryKey) throws SystemException {
	Session session = null;

	try {
		session = applicationPersistence.openSession();

		return (org.oep.ssomgt.model.ApplicationAppBigIconBlobModel)session.get(ApplicationAppBigIconBlobModel.class,
			primaryKey);
	}
	catch (Exception e) {
		throw applicationPersistence.processException(e);
	}
	finally {
		applicationPersistence.closeSession(session);
	}
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:19,代码来源:ApplicationLocalServiceBaseImpl.java

示例2: 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);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:40,代码来源:DictCollectionPersistenceImpl.java

示例3: 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;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:DictCollectionPersistenceImpl.java

示例4: 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);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:38,代码来源:VotingPersistenceImpl.java

示例5: 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;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:VotingPersistenceImpl.java

示例6: remove

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
/**
 * Removes the voting result with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the voting result
 * @return the voting result that was removed
 * @throws NoSuchVotingResultException if a voting result with the primary key could not be found
 */
@Override
public VotingResult remove(Serializable primaryKey)
	throws NoSuchVotingResultException {
	Session session = null;

	try {
		session = openSession();

		VotingResult votingResult = (VotingResult)session.get(VotingResultImpl.class,
				primaryKey);

		if (votingResult == null) {
			if (_log.isDebugEnabled()) {
				_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
			}

			throw new NoSuchVotingResultException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				primaryKey);
		}

		return remove(votingResult);
	}
	catch (NoSuchVotingResultException nsee) {
		throw nsee;
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:40,代码来源:VotingResultPersistenceImpl.java

示例7: removeImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
protected VotingResult removeImpl(VotingResult votingResult) {
	votingResult = toUnwrappedModel(votingResult);

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(votingResult)) {
			votingResult = (VotingResult)session.get(VotingResultImpl.class,
					votingResult.getPrimaryKeyObj());
		}

		if (votingResult != null) {
			session.delete(votingResult);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	if (votingResult != null) {
		clearCache(votingResult);
	}

	return votingResult;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:VotingResultPersistenceImpl.java

示例8: remove

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
/**
 * Removes the dict item with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the dict item
 * @return the dict item that was removed
 * @throws NoSuchDictItemException if a dict item with the primary key could not be found
 */
@Override
public DictItem remove(Serializable primaryKey)
	throws NoSuchDictItemException {
	Session session = null;

	try {
		session = openSession();

		DictItem dictItem = (DictItem)session.get(DictItemImpl.class,
				primaryKey);

		if (dictItem == null) {
			if (_log.isDebugEnabled()) {
				_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
			}

			throw new NoSuchDictItemException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				primaryKey);
		}

		return remove(dictItem);
	}
	catch (NoSuchDictItemException nsee) {
		throw nsee;
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:40,代码来源:DictItemPersistenceImpl.java

示例9: removeImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
protected DictItem removeImpl(DictItem dictItem) {
	dictItem = toUnwrappedModel(dictItem);

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(dictItem)) {
			dictItem = (DictItem)session.get(DictItemImpl.class,
					dictItem.getPrimaryKeyObj());
		}

		if (dictItem != null) {
			session.delete(dictItem);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	if (dictItem != null) {
		clearCache(dictItem);
	}

	return dictItem;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:DictItemPersistenceImpl.java

示例10: remove

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
/**
 * Removes the dict item group with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the dict item group
 * @return the dict item group that was removed
 * @throws NoSuchDictItemGroupException if a dict item group with the primary key could not be found
 */
@Override
public DictItemGroup remove(Serializable primaryKey)
	throws NoSuchDictItemGroupException {
	Session session = null;

	try {
		session = openSession();

		DictItemGroup dictItemGroup = (DictItemGroup)session.get(DictItemGroupImpl.class,
				primaryKey);

		if (dictItemGroup == null) {
			if (_log.isDebugEnabled()) {
				_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
			}

			throw new NoSuchDictItemGroupException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				primaryKey);
		}

		return remove(dictItemGroup);
	}
	catch (NoSuchDictItemGroupException nsee) {
		throw nsee;
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:40,代码来源:DictItemGroupPersistenceImpl.java

示例11: removeImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
protected DictItemGroup removeImpl(DictItemGroup dictItemGroup) {
	dictItemGroup = toUnwrappedModel(dictItemGroup);

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(dictItemGroup)) {
			dictItemGroup = (DictItemGroup)session.get(DictItemGroupImpl.class,
					dictItemGroup.getPrimaryKeyObj());
		}

		if (dictItemGroup != null) {
			session.delete(dictItemGroup);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	if (dictItemGroup != null) {
		clearCache(dictItemGroup);
	}

	return dictItemGroup;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:DictItemGroupPersistenceImpl.java

示例12: remove

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
/**
 * Removes the dict group with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the dict group
 * @return the dict group that was removed
 * @throws NoSuchDictGroupException if a dict group with the primary key could not be found
 */
@Override
public DictGroup remove(Serializable primaryKey)
	throws NoSuchDictGroupException {
	Session session = null;

	try {
		session = openSession();

		DictGroup dictGroup = (DictGroup)session.get(DictGroupImpl.class,
				primaryKey);

		if (dictGroup == null) {
			if (_log.isDebugEnabled()) {
				_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
			}

			throw new NoSuchDictGroupException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				primaryKey);
		}

		return remove(dictGroup);
	}
	catch (NoSuchDictGroupException nsee) {
		throw nsee;
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:40,代码来源:DictGroupPersistenceImpl.java

示例13: removeImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
protected DictGroup removeImpl(DictGroup dictGroup) {
	dictGroup = toUnwrappedModel(dictGroup);

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(dictGroup)) {
			dictGroup = (DictGroup)session.get(DictGroupImpl.class,
					dictGroup.getPrimaryKeyObj());
		}

		if (dictGroup != null) {
			session.delete(dictGroup);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	if (dictGroup != null) {
		clearCache(dictGroup);
	}

	return dictGroup;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:DictGroupPersistenceImpl.java

示例14: remove

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
/**
 * Removes the comment with the primary key from the database. Also notifies the appropriate model listeners.
 *
 * @param primaryKey the primary key of the comment
 * @return the comment that was removed
 * @throws NoSuchCommentException if a comment with the primary key could not be found
 */
@Override
public Comment remove(Serializable primaryKey)
	throws NoSuchCommentException {
	Session session = null;

	try {
		session = openSession();

		Comment comment = (Comment)session.get(CommentImpl.class, primaryKey);

		if (comment == null) {
			if (_log.isDebugEnabled()) {
				_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
			}

			throw new NoSuchCommentException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				primaryKey);
		}

		return remove(comment);
	}
	catch (NoSuchCommentException nsee) {
		throw nsee;
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:CommentPersistenceImpl.java

示例15: removeImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
protected Comment removeImpl(Comment comment) {
	comment = toUnwrappedModel(comment);

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(comment)) {
			comment = (Comment)session.get(CommentImpl.class,
					comment.getPrimaryKeyObj());
		}

		if (comment != null) {
			session.delete(comment);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	if (comment != null) {
		clearCache(comment);
	}

	return comment;
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:CommentPersistenceImpl.java


注:本文中的com.liferay.portal.kernel.dao.orm.Session.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。