我不知道这是哪种编程语言,或者方法是什么,有什么帮助吗?
它可能是一些代码修改一些数据库表?
ClassMethod CreateNewConfiguration(pintInsTypeConf As %Integer) As %Integer
{
Set objRecord = ##class(Table.tInsTypeConfigurations).%OpenId(pintInsTypeConf)
Set objNewRecord = ##class(Table.tInsTypeConfigurations).%New()
Set objClassDef = ##class(%Dictionary.ClassDefinition).%OpenId("Table.tInsTypeConfigurations")
Set intTotal = objClassDef.Properties.Count()
For intCount = 1:1:intTotal
{
If (((objClassDef.Properties.GetAt(intCount).Relationship = 0) &&
(objClassDef.Properties.GetAt(intCount).Calculated = 0)) ||
((objClassDef.Properties.GetAt(intCount).Relationship = 1) &&
(objClassDef.Properties.GetAt(intCount).Cardinality = "one")))
{
Set strName = objClassDef.Properties.GetAt(intCount).Name
Set $zobjproperty(objNewRecord,strName) = $zobjproperty(objRecord,strName)
}
}
Set objNewRecord.Name = objNewRecord.rInstrumentTypes.%Id() _ " Config B “
Set intResult = objNewRecord.%Save()
If ((intResult '= 1) || ($ZERROR '= ""))
{
Quit 0
}
Quit objNewRecord.%Id()
}
是的,@duskwuff是对的,它是缓存ObjectScript代码。
在这段代码中,只是复制一些对象的属性,从类Table.tInsTypeConfigurations
id pintInsTypeConf
,到新的对象。这不是优化的代码,但无论如何,它应该完成这个任务。