English 中文(简体)
是否有从价值清单中确定实地价值的一般方法?
原标题:Is there a generic way of setting field values in mapper from list of values?
  • 时间:2011-11-22 07:49:56
  •  标签:
  • lift
  • mapper

是否有办法确定示范油田的价值而没有。 2. 明确确立价值观:

ModelName.create.fieldName1("value").fieldName2("value2") and so on

我们能否通过这一模式的所有现有领域加以利用,并确定其价值构成一些价值清单?

......

Model.allFields.foreach((fld)=> {
fld.set(valueList(indx)); indx+=1
}

Actually I want to set values into all models using some generic method that works for all models.

最佳回答

根据我的意见:

val list = List(...)
val record = YourRecordClass.createRecord
record.allFields.zip(list).foreach {case(field,value) => field.setFromAny(value)}
问题回答

暂无回答




相关问题
Scala and Lift and SessionVar that loses it contents

I have SessionVar like this in Lift: object MyObject { object myVar extends SessionVar[Box[MyObject]](Empty) } Then I set value once for myVar: MyObject.myVar(Full(value)) My problem is that ...

Write table on the fly

I have the following function, and I would like to write to the page instead of the println. How can I do that? I need a table with that information in my page, But I did t find any information about ...

lift CalendarMonthView sample fails with Lift 1.1-SNAPSHOT

A newbie scala/lift question: I checked out the CalendarMonthView sample: http://scala-tools.org/mvnsites/liftweb-1.0/lift-widgets/scaladocs/net/liftweb/widgets/calendars/CalendarMonthView.html ...

Scala 2.8 and Lift status

Whats the status of Lift working with Scala 2.8? I m finding fragments of conversations about it on the web. I ve been trying tweaking the pom.xml but I m getting errors from the Lift side of things.

热门标签