Private Property
Hello,
I read the Cache Documentation where it describes Private Property as below:
Comments
All you need to do is, to specify the property name/sql field name in the select-list of your query.
Thank you! Can you please explain providing an example, that would really help!
Let me add some more details here.
I have a class where I have a private property "Active"
I also tried a simple query "Select Active from classname" and it does not print any data for this property in the result
Also using it in WHERE clause does not return any data.
It will probably be "too basic" for your needs, but I was curious to test this, and got it working with the following class example:
Class Test.PrivateTest Extends (%Persistent, %Populate)
{
Property Name As %String(POPSPEC = "Name()") [ Required ];
Property NickName As %String(POPSPEC = "Name()") [ Private ];
}
A "select * from Test.PrivateTest" would only return my "Name" data, while a "select Name,NickName from Test.PrivateTest" returns the private property values too.
Can you get such a basic example working for you too?
If you post your class definition, someone could have some better suggestions/ideas.
My property definition is as below:
Property Active As %Integer [ Calculated, Private, SqlComputeCode = { Set {Active}='$D(^ADZDICT("OS80",1,{HospitalCode},1,{LocationCode},"ACT"))
}, SqlComputed ];
I have a method:
Method ActiveGet() As %Integer
{
Q '$D(^ADZDICT("OS80",1,..HospitalCode,1,..LocationCode,"ACT"))
}
I have to pass.. as my example, expanded with your calculated/private Active property (a simplified version of it), still works as I would expect it to:
Property Name As %String(POPSPEC = "Name()") [ Required ];
Property NickName As %String(POPSPEC = "Name()") [ Private ];
Property Active As %Integer [ Calculated, Private, SqlComputeCode = { Set {Active}=($R(100))}, SqlComputed ];
select Name,NickName,Active from Test.PrivateTest
Name NickName ActiveHills,Lawrence B. Wilson,Barb G. 0
Frost,Brendan H. Smith,Zoe T. 98
Cooper,Tara C. Edwards,Mo G. 19
Hanson,Howard H. Cerri,Buzz X. 74
Hammel,Elmo P. Klausner,Peter G. 77
Quincy,Robert Q. Townsend,Alice M. 52
Does it work if its not active?