How to Get the Property's DisplayList data of ValueList from Java
Hi All,
I trying to get the DisplayList data of the ValueLIst from Java using Springboot. when I try to get the DislayList data via java code but I'm getting the VALUELIST data. I don't get any idea to get that DisplayList data. Below is the example
Java Code:
public String PetName;
public List<Pet> getPet() {
return ser.findAll();
}
List<Pet> arrayList = getPet();
for (Patient list : arrayList) {
String pet= list.getPet();
System.out.println("Pet Name --->" + pet);
}
If PetName value is 2 I am getting output 2 not "Dog". Which means it return the interger value not the string value. So how to get that. Please help me...
Thanks,
Vikram
I'm not that java guy, so just a hint only.
There should be a
method, so use/call this method to display your pets.
Thanks for your reply Julius,
But the getPet() is accessing the DB query using SpringBoot. The findAll() method return only List type not String type.
So, do you have any other ideas. If yes, Please let me know.
As I wrote above, Java is not my case, sorry. Maybe the link below gives you some clue
https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AFL_javagateway
You need to tell Springboot to fetch data in display mode or use %EXTERNAL function on column value. That's Java side.
Alternatively, on InterSystems side you can create a calculated property and access it in Java (replace !!! with full class name):
Remove SqlComputeOnChange and add Calculated if you want it always computed instead of trigger-computed and stored.