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


Java PO.set_TrxName方法代码示例

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


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

示例1: copyPO

import org.compiere.model.PO; //导入方法依赖的package包/类
/**
 * Creates a copy of orginal PO, having given <code>trxName</code>.
 * 
 * @param originalPO
 * @param trxName
 * @return
 *         <ul>
 *         <li>copy of <code>originalPO</code>;
 *         <li>if original PO is null, null will be returned;
 *         <li>if there is an error while cloning given PO, null will be returned but an warning will be logged (just to not stop the current execution)
 *         </ul>
 */
private final PO copyPO(final PO originalPO, final String trxName)
{
	if (originalPO == null)
	{
		return null;
	}

	PO poToReturn;
	try
	{
		final PO poNoTrxCopy = originalPO.copy();
		poNoTrxCopy.set_TrxName(trxName);
		poToReturn = poNoTrxCopy;
	}
	catch (Exception e)
	{
		logger.warn("Cannot create a copy of " + originalPO + ". Returning null.", e);
		poToReturn = null;
	}
	return poToReturn;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:34,代码来源:ModelCacheService.java

示例2: setTrxName

import org.compiere.model.PO; //导入方法依赖的package包/类
public static void setTrxName(final Object model, final String trxName)
{
	if (model == null)
	{
		throw new IllegalArgumentException("model is null");
	}
	final PO po = getStrictPO(model);
	if (po == null)
	{
		throw new ModelClassNotSupportedException(model);
	}

	po.set_TrxName(trxName);

}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:16,代码来源:POWrapper.java

示例3: exportRecord

import org.compiere.model.PO; //导入方法依赖的package包/类
/**
 * Export a limited number of POs for the given format and where clause.
 *
 * @param exportFormat
 * @param where
 * @param ReplicationMode
 * @param ReplicationType
 * @param ReplicationEvent
 * @param limit limit the number of exported records. This makes sense when we want to export only a few sample records for the given format.
 * @return
 * @throws Exception
 */
public Document exportRecord(final MEXPFormat exportFormat, final String where, final Integer ReplicationMode, final String ReplicationType, final Integer ReplicationEvent,
		final IReplicationAccessContext racCtx)
		throws Exception
{
	final I_AD_Client client = Services.get(IClientDAO.class).retriveClient(exportFormat.getCtx(), m_AD_Client_ID);
	final MTable table = MTable.get(exportFormat.getCtx(), exportFormat.getAD_Table_ID());
	log.info("Table = " + table);

	// metas: begin: build where clause
	final StringBuffer whereClause = new StringBuffer("1=1");
	if (!Check.isEmpty(exportFormat.getWhereClause(), true))
	{
		whereClause.append(" AND (").append(exportFormat.getWhereClause()).append(")");
	}
	if (!Check.isEmpty(where))
	{
		whereClause.append(" AND (").append(where).append(")");
	}
	// metas: end

	final Collection<PO> records = new Query(exportFormat.getCtx(), table.getTableName(), whereClause.toString(), exportFormat.get_TrxName())
			.setOnlyActiveRecords(true)
			.setApplyAccessFilter(racCtx.isApplyAccessFilter())
			.setLimit(racCtx.getLimit())
			.list();

	for (final PO po : records)
	{
		log.info("Client = " + client.toString());
		log.trace("po.getAD_Org_ID() = " + po.getAD_Org_ID());
		log.trace("po.get_TrxName() = " + po.get_TrxName());
		if (po.get_TrxName() == null || po.get_TrxName().equals(""))
		{
			po.set_TrxName("exportRecord");
		}

		if (po.get_KeyColumns().length < 1)
		{
			throw new Exception(Services.get(IMsgBL.class).getMsg(po.getCtx(), "ExportNoneColumnKeyNotSupported")); // TODO: Create Mesagge.
		}

		outDocument = createNewDocument();

		final HashMap<String, Integer> variableMap = new HashMap<String, Integer>();
		final Element rootElement = generateRootElement(exportFormat, outDocument, ReplicationMode, ReplicationType, ReplicationEvent, client);

		generateExportFormat(outDocument, rootElement, exportFormat, po, variableMap, racCtx);
	} // finish record read
	return outDocument;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:63,代码来源:ExportHelper.java


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