本文整理汇总了Java中org.compiere.model.PO.get_ValueAsInt方法的典型用法代码示例。如果您正苦于以下问题:Java PO.get_ValueAsInt方法的具体用法?Java PO.get_ValueAsInt怎么用?Java PO.get_ValueAsInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.compiere.model.PO
的用法示例。
在下文中一共展示了PO.get_ValueAsInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEvaluationContext
import org.compiere.model.PO; //导入方法依赖的package包/类
@Override
public Evaluatee createEvaluationContext()
{
final Properties privateCtx = Env.deriveCtx(getCtx());
final PO po = getPO();
final POInfo poInfo = po.getPOInfo();
for (int i = 0; i < poInfo.getColumnCount(); i++)
{
final Object val;
final int dispType = poInfo.getColumnDisplayType(i);
if (DisplayType.isID(dispType))
{
// make sure we get a 0 instead of a null for foreign keys
val = po.get_ValueAsInt(i);
}
else
{
val = po.get_Value(i);
}
if (val == null)
{
continue;
}
if (val instanceof Integer)
{
Env.setContext(privateCtx, "#" + po.get_ColumnName(i), (Integer)val);
}
else if (val instanceof String)
{
Env.setContext(privateCtx, "#" + po.get_ColumnName(i), (String)val);
}
}
return Evaluatees.ofCtx(privateCtx, Env.WINDOW_None, false);
}
示例2: copyValues
import org.compiere.model.PO; //导入方法依赖的package包/类
private void copyValues(PO from, PO to)
{
PO.copyValues(from, to);
to.setIsActive(from.isActive());
final POInfo poInfo = POInfo.getPOInfo(to.getCtx(), to.get_Table_ID(), to.get_TrxName());
final String tableName = poInfo.getTableName();
for (int i = 0 ; i < poInfo.getColumnCount(); i++)
{
final String columnName = poInfo.getColumnName(i);
if (to.is_new() && isIgnoreColumn(tableName, columnName))
{
Object valueOld = to.get_ValueOld(i);
to.set_ValueNoCheck(columnName, valueOld);
continue;
}
String baseTableName = getColumnBaseTableName(poInfo, i);
if (baseTableName == null)
continue;
int idOld = to.get_ValueAsInt(i);
if (idsMap.hasNewId(baseTableName, idOld))
{
int idNew = idsMap.getNewId(baseTableName, idOld);
to.set_ValueNoCheck(to.get_ColumnName(i), idNew);
}
}
}