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


Java Session.save方法代码示例

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


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

示例1: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public EbMessage updateImpl(org.oep.dossiermgt.model.EbMessage ebMessage)
	throws SystemException {
	ebMessage = toUnwrappedModel(ebMessage);

	boolean isNew = ebMessage.isNew();

	Session session = null;

	try {
		session = openSession();

		if (ebMessage.isNew()) {
			session.save(ebMessage);

			ebMessage.setNew(false);
		}
		else {
			session.merge(ebMessage);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(EbMessageModelImpl.ENTITY_CACHE_ENABLED,
		EbMessageImpl.class, ebMessage.getPrimaryKey(), ebMessage);

	return ebMessage;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:40,代码来源:EbMessagePersistenceImpl.java

示例2: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public DossierDoc updateImpl(
	org.oep.core.dossiermgt.model.DossierDoc dossierDoc)
	throws SystemException {
	dossierDoc = toUnwrappedModel(dossierDoc);

	boolean isNew = dossierDoc.isNew();

	Session session = null;

	try {
		session = openSession();

		if (dossierDoc.isNew()) {
			session.save(dossierDoc);

			dossierDoc.setNew(false);
		}
		else {
			session.merge(dossierDoc);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(DossierDocModelImpl.ENTITY_CACHE_ENABLED,
		DossierDocImpl.class, dossierDoc.getPrimaryKey(), dossierDoc);

	return dossierDoc;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:41,代码来源:DossierDocPersistenceImpl.java

示例3: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public CreateFile updateImpl(org.oep.processmgt.model.CreateFile createFile)
	throws SystemException {
	createFile = toUnwrappedModel(createFile);

	boolean isNew = createFile.isNew();

	Session session = null;

	try {
		session = openSession();

		if (createFile.isNew()) {
			session.save(createFile);

			createFile.setNew(false);
		}
		else {
			session.merge(createFile);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(CreateFileModelImpl.ENTITY_CACHE_ENABLED,
		CreateFileImpl.class, createFile.getPrimaryKey(), createFile);

	return createFile;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:40,代码来源:CreateFilePersistenceImpl.java

示例4: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public AHConfig updateImpl(
    de.fraunhofer.fokus.oefit.particity.model.AHConfig ahConfig)
    throws SystemException {
    ahConfig = toUnwrappedModel(ahConfig);

    boolean isNew = ahConfig.isNew();

    Session session = null;

    try {
        session = openSession();

        if (ahConfig.isNew()) {
            session.save(ahConfig);

            ahConfig.setNew(false);
        } else {
            session.merge(ahConfig);
        }
    } catch (Exception e) {
        throw processException(e);
    } finally {
        closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew) {
        FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    EntityCacheUtil.putResult(AHConfigModelImpl.ENTITY_CACHE_ENABLED,
        AHConfigImpl.class, ahConfig.getPrimaryKey(), ahConfig);

    return ahConfig;
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:38,代码来源:AHConfigPersistenceImpl.java

示例5: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public DossierStep updateImpl(
	org.oep.core.processmgt.model.DossierStep dossierStep)
	throws SystemException {
	dossierStep = toUnwrappedModel(dossierStep);

	boolean isNew = dossierStep.isNew();

	Session session = null;

	try {
		session = openSession();

		if (dossierStep.isNew()) {
			session.save(dossierStep);

			dossierStep.setNew(false);
		}
		else {
			session.merge(dossierStep);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(DossierStepModelImpl.ENTITY_CACHE_ENABLED,
		DossierStepImpl.class, dossierStep.getPrimaryKey(), dossierStep);

	return dossierStep;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:41,代码来源:DossierStepPersistenceImpl.java

示例6: updateImpl

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

	boolean isNew = region.isNew();

	Session session = null;

	try {
		session = openSession();

		if (region.isNew()) {
			session.save(region);

			region.setNew(false);
		}
		else {
			region = (Region)session.merge(region);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		finderCache.removeResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY);
		finderCache.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL,
			FINDER_ARGS_EMPTY);
	}

	entityCache.putResult(RegionModelImpl.ENTITY_CACHE_ENABLED,
		RegionImpl.class, region.getPrimaryKey(), region, false);

	region.resetOriginalValues();

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

示例7: updateImpl

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

	boolean isNew = country.isNew();

	Session session = null;

	try {
		session = openSession();

		if (country.isNew()) {
			session.save(country);

			country.setNew(false);
		}
		else {
			country = (Country)session.merge(country);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		finderCache.removeResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY);
		finderCache.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL,
			FINDER_ARGS_EMPTY);
	}

	entityCache.putResult(CountryModelImpl.ENTITY_CACHE_ENABLED,
		CountryImpl.class, country.getPrimaryKey(), country, false);

	country.resetOriginalValues();

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

示例8: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public DossierStep2Role updateImpl(
	org.oep.core.processmgt.model.DossierStep2Role dossierStep2Role)
	throws SystemException {
	dossierStep2Role = toUnwrappedModel(dossierStep2Role);

	boolean isNew = dossierStep2Role.isNew();

	Session session = null;

	try {
		session = openSession();

		if (dossierStep2Role.isNew()) {
			session.save(dossierStep2Role);

			dossierStep2Role.setNew(false);
		}
		else {
			session.merge(dossierStep2Role);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(DossierStep2RoleModelImpl.ENTITY_CACHE_ENABLED,
		DossierStep2RoleImpl.class, dossierStep2Role.getPrimaryKey(),
		dossierStep2Role);

	return dossierStep2Role;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:DossierStep2RolePersistenceImpl.java

示例9: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public TransitionHistory updateImpl(
	org.oep.core.processmgt.model.TransitionHistory transitionHistory)
	throws SystemException {
	transitionHistory = toUnwrappedModel(transitionHistory);

	boolean isNew = transitionHistory.isNew();

	Session session = null;

	try {
		session = openSession();

		if (transitionHistory.isNew()) {
			session.save(transitionHistory);

			transitionHistory.setNew(false);
		}
		else {
			session.merge(transitionHistory);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(TransitionHistoryModelImpl.ENTITY_CACHE_ENABLED,
		TransitionHistoryImpl.class, transitionHistory.getPrimaryKey(),
		transitionHistory);

	return transitionHistory;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:TransitionHistoryPersistenceImpl.java

示例10: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public DossierDoc2Template updateImpl(
	org.oep.core.dossiermgt.model.DossierDoc2Template dossierDoc2Template)
	throws SystemException {
	dossierDoc2Template = toUnwrappedModel(dossierDoc2Template);

	boolean isNew = dossierDoc2Template.isNew();

	Session session = null;

	try {
		session = openSession();

		if (dossierDoc2Template.isNew()) {
			session.save(dossierDoc2Template);

			dossierDoc2Template.setNew(false);
		}
		else {
			session.merge(dossierDoc2Template);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(DossierDoc2TemplateModelImpl.ENTITY_CACHE_ENABLED,
		DossierDoc2TemplateImpl.class, dossierDoc2Template.getPrimaryKey(),
		dossierDoc2Template);

	return dossierDoc2Template;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:DossierDoc2TemplatePersistenceImpl.java

示例11: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public StepTransition updateImpl(
	org.oep.core.processmgt.model.StepTransition stepTransition)
	throws SystemException {
	stepTransition = toUnwrappedModel(stepTransition);

	boolean isNew = stepTransition.isNew();

	Session session = null;

	try {
		session = openSession();

		if (stepTransition.isNew()) {
			session.save(stepTransition);

			stepTransition.setNew(false);
		}
		else {
			session.merge(stepTransition);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(StepTransitionModelImpl.ENTITY_CACHE_ENABLED,
		StepTransitionImpl.class, stepTransition.getPrimaryKey(),
		stepTransition);

	return stepTransition;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:StepTransitionPersistenceImpl.java

示例12: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public StatisticByDay updateImpl(
	org.oep.dossiermgt.model.StatisticByDay statisticByDay)
	throws SystemException {
	statisticByDay = toUnwrappedModel(statisticByDay);

	boolean isNew = statisticByDay.isNew();

	Session session = null;

	try {
		session = openSession();

		if (statisticByDay.isNew()) {
			session.save(statisticByDay);

			statisticByDay.setNew(false);
		}
		else {
			session.merge(statisticByDay);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(StatisticByDayModelImpl.ENTITY_CACHE_ENABLED,
		StatisticByDayImpl.class, statisticByDay.getPrimaryKey(),
		statisticByDay);

	return statisticByDay;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:StatisticByDayPersistenceImpl.java

示例13: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public DossierProcAgent updateImpl(
	org.oep.dossiermgt.model.DossierProcAgent dossierProcAgent)
	throws SystemException {
	dossierProcAgent = toUnwrappedModel(dossierProcAgent);

	boolean isNew = dossierProcAgent.isNew();

	Session session = null;

	try {
		session = openSession();

		if (dossierProcAgent.isNew()) {
			session.save(dossierProcAgent);

			dossierProcAgent.setNew(false);
		}
		else {
			session.merge(dossierProcAgent);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(DossierProcAgentModelImpl.ENTITY_CACHE_ENABLED,
		DossierProcAgentImpl.class, dossierProcAgent.getPrimaryKey(),
		dossierProcAgent);

	return dossierProcAgent;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:DossierProcAgentPersistenceImpl.java

示例14: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public StatisticByAgency updateImpl(
	org.oep.core.dossiermgt.model.StatisticByAgency statisticByAgency)
	throws SystemException {
	statisticByAgency = toUnwrappedModel(statisticByAgency);

	boolean isNew = statisticByAgency.isNew();

	Session session = null;

	try {
		session = openSession();

		if (statisticByAgency.isNew()) {
			session.save(statisticByAgency);

			statisticByAgency.setNew(false);
		}
		else {
			session.merge(statisticByAgency);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(StatisticByAgencyModelImpl.ENTITY_CACHE_ENABLED,
		StatisticByAgencyImpl.class, statisticByAgency.getPrimaryKey(),
		statisticByAgency);

	return statisticByAgency;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:StatisticByAgencyPersistenceImpl.java

示例15: updateImpl

import com.liferay.portal.kernel.dao.orm.Session; //导入方法依赖的package包/类
@Override
public StatisticByDomain updateImpl(
	org.oep.core.dossiermgt.model.StatisticByDomain statisticByDomain)
	throws SystemException {
	statisticByDomain = toUnwrappedModel(statisticByDomain);

	boolean isNew = statisticByDomain.isNew();

	Session session = null;

	try {
		session = openSession();

		if (statisticByDomain.isNew()) {
			session.save(statisticByDomain);

			statisticByDomain.setNew(false);
		}
		else {
			session.merge(statisticByDomain);
		}
	}
	catch (Exception e) {
		throw processException(e);
	}
	finally {
		closeSession(session);
	}

	FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

	if (isNew) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	EntityCacheUtil.putResult(StatisticByDomainModelImpl.ENTITY_CACHE_ENABLED,
		StatisticByDomainImpl.class, statisticByDomain.getPrimaryKey(),
		statisticByDomain);

	return statisticByDomain;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:42,代码来源:StatisticByDomainPersistenceImpl.java


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