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


Java Record.set方法代码示例

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


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

示例1: format

import com.jfinal.plugin.activerecord.Record; //导入方法依赖的package包/类
public static void format(List<Record> sheet, Object... params)
{
	if (params.length % 2 != 0) throw new RuntimeException("参数个数有误");
	
	for (int x = 0; x < sheet.size(); x++)
	{
		try
		{
			Record t = sheet.get(x);
			for (int i = 0; i < params.length; i += 2)
			{
				String field = (String)params[i];
				Formattable fmt = (Formattable)params[i + 1];
				t.set("fmt_" + field, fmt.format(t.get(field)));
			}
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
 
开发者ID:glaciall,项目名称:jfinal-dbx,代码行数:23,代码来源:DbUtil.java

示例2: join

import com.jfinal.plugin.activerecord.Record; //导入方法依赖的package包/类
public static void join(List<Record> list, Object... params)
{
	if (params.length % 3 != 0) throw new RuntimeException("参数个数有误");
	for (int x = 0; x < list.size(); x++)
	{
		Record t = list.get(x);
		try
		{
			for (int i = 0; i < params.length; i += 3)
			{
				String refField = (String)params[i];
				String newName = (String)params[i + 1];
				Formattable fmt = (Formattable)params[i + 2];
				t.set(newName, fmt.format(t.get(refField)));
			}
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
 
开发者ID:glaciall,项目名称:jfinal-dbx,代码行数:23,代码来源:DbUtil.java

示例3: combine

import com.jfinal.plugin.activerecord.Record; //导入方法依赖的package包/类
public static void combine(List<Record> list, Object... fields)
{
	if (fields.length < 3) throw new RuntimeException("combine方法至少需要4个参数");
	if (!(fields[fields.length - 1] instanceof Formattable)) throw new RuntimeException("最后一个参数必须是Formattable实例");
	Formattable fmt = (Formattable)fields[fields.length - 1];
	for (int i = 0; i < list.size(); i++)
	{
		Record rc = list.get(i);
		HashMap<String, Object> pairs = new HashMap<String, Object>();
		for (int k = 0, s = 0, l = fields.length - 2; k < l; k++)
		{
			pairs.put((String)fields[k], rc.get((String)fields[k]));
		}
		Object val = fmt.combine(pairs);
		
		rc.set((String)fields[fields.length - 2], val);
	}
}
 
开发者ID:glaciall,项目名称:jfinal-dbx,代码行数:19,代码来源:DbUtil.java

示例4: toRecord

import com.jfinal.plugin.activerecord.Record; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public static Record toRecord(Model model) {
	Record record = new Record();
	Set<Entry<String, Object>> attrs = model._getAttrsEntrySet();
	for (Entry<String, Object> entry : attrs) {
		record.set(entry.getKey(), entry.getValue());
	}
	return record;
}
 
开发者ID:jflyfox,项目名称:jflyfox_jfinal,代码行数:10,代码来源:ModelKit.java

示例5: set

import com.jfinal.plugin.activerecord.Record; //导入方法依赖的package包/类
@Override
public void set(Record bean, Object property, Object value) {
    bean.set(property.toString(), value);
}
 
开发者ID:febit,项目名称:wit,代码行数:5,代码来源:RecordResolver.java


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