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


Java Session.contains方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: removeImpl

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

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(region)) {
			region = (Region)session.get(RegionImpl.class,
					region.getPrimaryKeyObj());
		}

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

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

	return region;
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:32,代码来源:RegionPersistenceImpl.java

示例9: removeImpl

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

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(country)) {
			country = (Country)session.get(CountryImpl.class,
					country.getPrimaryKeyObj());
		}

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

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

	return country;
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:32,代码来源:CountryPersistenceImpl.java

示例10: removeImpl

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

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(foo)) {
			foo = (Foo)session.get(FooImpl.class, foo.getPrimaryKeyObj());
		}

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

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

	return foo;
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:31,代码来源:FooPersistenceImpl.java

示例11: removeImpl

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

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(business)) {
			business = (Business)session.get(BusinessImpl.class,
					business.getPrimaryKeyObj());
		}

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

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

	return business;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:32,代码来源:BusinessPersistenceImpl.java

示例12: removeImpl

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

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(paymentFile)) {
			paymentFile = (PaymentFile)session.get(PaymentFileImpl.class,
					paymentFile.getPrimaryKeyObj());
		}

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

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

	return paymentFile;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:33,代码来源:PaymentFilePersistenceImpl.java

示例13: removeImpl

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

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(userAssignment)) {
			userAssignment = (UserAssignment)session.get(UserAssignmentImpl.class,
					userAssignment.getPrimaryKeyObj());
		}

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

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

	return userAssignment;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:33,代码来源:UserAssignmentPersistenceImpl.java

示例14: removeImpl

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

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(dictMetaData)) {
			dictMetaData = (DictMetaData)session.get(DictMetaDataImpl.class,
					dictMetaData.getPrimaryKeyObj());
		}

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

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

	return dictMetaData;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:33,代码来源:DictMetaDataPersistenceImpl.java

示例15: removeImpl

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

	Session session = null;

	try {
		session = openSession();

		if (!session.contains(citizen)) {
			citizen = (Citizen)session.get(CitizenImpl.class,
					citizen.getPrimaryKeyObj());
		}

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

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

	return citizen;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:32,代码来源:CitizenPersistenceImpl.java


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