Skip to content

Instantly share code, notes, and snippets.

@eduard93
Created December 23, 2019 16:53
Show Gist options
  • Save eduard93/9ac734fd94f2cbd6a3a19c38847b254b to your computer and use it in GitHub Desktop.
Save eduard93/9ac734fd94f2cbd6a3a19c38847b254b to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2019.4.0ML (Build 147U)" ts="2019-12-23 19:53:29">
<Class name="Test.A">
<Super>%Persistent,%JSON.Adaptor</Super>
<TimeChanged>65370,71532.559211</TimeChanged>
<TimeCreated>65370,70856.941877</TimeCreated>
<Property name="A">
<Type>A</Type>
<Parameter name="%JSONINCLUDE" value="INOUT"/>
<Parameter name="%JSONREFERENCE" value="ID"/>
</Property>
<Property name="B">
<Type>B</Type>
<Parameter name="%JSONINCLUDE" value="INOUT"/>
<Parameter name="%JSONREFERENCE" value="ID"/>
</Property>
<Method name="Test">
<Description>
do ##class(Test.A).Test()</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
do ..%KillExtent()
do ##class(B).%KillExtent()
set obj = ..%New()
set sc = obj.%Save()
kill obj
set obj = ..%OpenId(1)
set sc = obj.%JSONImport({"B":-1})
//zw obj
w "Setting B property: ", $System.Status.GetErrorText(sc),!
set sc = obj.%Save()
w "Saving: ", $System.Status.GetErrorText(sc),!
set sc = obj.%JSONImport({"A":-1})
w "Setting A property: ", $System.Status.GetErrorText(sc),!
set sc = obj.%Save()
w "Saving: ", $System.Status.GetErrorText(sc),!
]]></Implementation>
</Method>
<Storage name="Default">
<Type>%Storage.Persistent</Type>
<DataLocation>^Test.AD</DataLocation>
<DefaultData>ADefaultData</DefaultData>
<IdLocation>^Test.AD</IdLocation>
<IndexLocation>^Test.AI</IndexLocation>
<StreamLocation>^Test.AS</StreamLocation>
<Data name="ADefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>A</Value>
</Value>
<Value name="3">
<Value>B</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="Test.B">
<Super>%Persistent,%JSON.Adaptor</Super>
<TimeChanged>65370,70876.105326</TimeChanged>
<TimeCreated>65370,70875.833813</TimeCreated>
<Storage name="Default">
<Type>%Storage.Persistent</Type>
<DataLocation>^Test.BD</DataLocation>
<DefaultData>BDefaultData</DefaultData>
<IdLocation>^Test.BD</IdLocation>
<IndexLocation>^Test.BI</IndexLocation>
<StreamLocation>^Test.BS</StreamLocation>
<Data name="BDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
</Storage>
</Class>
</Export>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment