本文整理汇总了Java中org.compiere.model.PO.get_ColumnCount方法的典型用法代码示例。如果您正苦于以下问题:Java PO.get_ColumnCount方法的具体用法?Java PO.get_ColumnCount怎么用?Java PO.get_ColumnCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.compiere.model.PO
的用法示例。
在下文中一共展示了PO.get_ColumnCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChangeLog
import org.compiere.model.PO; //导入方法依赖的package包/类
private String getChangeLog(PO po)
{
StringBuffer sb = new StringBuffer();
for (int i = 0; i < po.get_ColumnCount(); i++)
{
if (!po.is_ValueChanged(i))
continue;
String columnName = po.get_ColumnName(i);
Object valueOld = po.get_ValueOld(i);
Object valueNew = po.get_Value(i);
if (sb.length() > 0)
sb.append("; ");
sb.append(columnName).append(":[").append(valueOld).append("]->[").append(valueNew).append("]");
}
return sb.toString();
}
示例2: copyValues
import org.compiere.model.PO; //导入方法依赖的package包/类
private void copyValues(PO sourcePO, PO targetPO)
{
for (int i = 0; i < sourcePO.get_ColumnCount(); i++)
{
String columnName = sourcePO.get_ColumnName(i);
Object value = sourcePO.get_Value(i);
targetPO.set_ValueNoCheck(columnName, value);
}
}
示例3: logMigration
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public void logMigration(final IMigrationLoggerContext migrationCtx, final PO po, final POInfo info, final String event)
{
if (!migrationCtx.isEnabled())
{
return;
}
if (!isLogTableName(po.get_TableName()))
{
return;
}
if (!isLogPO(po, info))
{
return;
}
I_AD_MigrationStep migrationStep = null;
List<I_AD_MigrationData> stepDataList = null;
final int size = po.get_ColumnCount();
for (int i = 0; i < size; i++)
{
final I_AD_MigrationData data = createMigrationData(po, info, i, event);
//
// Save if needed
if (data != null)
{
if (migrationStep == null)
{
migrationStep = createMigrationStep(migrationCtx, po, event);
stepDataList = new ArrayList<>();
}
data.setAD_MigrationStep_ID(migrationStep.getAD_MigrationStep_ID());
InterfaceWrapperHelper.save(data);
stepDataList.add(data);
}
}
//
// Set migration comments (useful for quick review)
if (migrationStep != null && !stepDataList.isEmpty())
{
setComments(po, migrationStep, stepDataList);
}
}
示例4: updateContext
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
* Export attributes from session to context.
*
* Used context prefix is {@link #CTX_Prefix}.
*
* Attributes that will be exported to context are: String with FieldLength <= 60.
*
* @return true if context was updated
*/
public boolean updateContext(final Properties ctx)
{
final int sessionId = getAD_Session_ID();
if (sessionId <= 0)
{
log.warn("Cannot update context because session is not saved yet");
return false;
}
if (!sessionPO.isActive())
{
log.debug("Cannot update context because session is not active");
return false;
}
if (isDestroyed())
{
log.debug("Cannot update context because session is destroyed");
return false;
}
//
// If not force, update the context only if the context #AD_Session_ID is same as our session ID.
// Even if there is no value in context, the session won't be updated.
// Keep this logic because we are calling this method on afterSave too.
final int ctxSessionId = Env.getContextAsInt(ctx, Env.CTXNAME_AD_Session_ID);
if (ctxSessionId > 0 && ctxSessionId != sessionId)
{
log.debug("Different AD_Session_ID found in context and force=false.");
}
Env.setContext(ctx, Env.CTXNAME_AD_Session_ID, sessionId);
final PO po = InterfaceWrapperHelper.getStrictPO(sessionPO);
final int cols = po.get_ColumnCount();
for (int i = 0; i < cols; i++)
{
if (!isContextAttribute(i))
{
continue;
}
final String columnName = po.get_ColumnName(i);
final String value = po.get_ValueAsString(columnName);
Env.setContext(ctx, CTX_Prefix + columnName, value);
}
return true;
}