I’m actually able to save data in DB but when I run the sample opereffa code to load and print data into console,
…
wrapperToLoadData.loadFromPOJO(archetypeDatas);
System.out.println(wrapperToLoadData.getRootWrapper().getGUITestString());
But I can just retrieve boolean values. it sounds somewhere I loose value (numbers) for quantity elements…
Any idea about the reason?
Hi Pariya,
For some reason, I am getting mails from the group with a delay. Anyway, regarding your question; the code you have given is doing what it is supposed to do. It is returning a
QuantityInfo object, containing the quantity magnitude and unit. When this method is called, there is a datavalue object in the wrapper, and this method returns information about the dvquantity, that is all. There is not reason to set any value where you have commented.
I’ve created a modified version of the ArchetypeSaveLoadExample.java class, along with a modified version of one of the observation archetypes used by Opereffa. Both the java and adl files are attached. You should place the archetype file under the archetype repository dir, and the java file should simply work in Eclipse environment (it is a class which already exists in the Opereffa source tree). I assume you are already using this class, looking at the snippet you have given.
Using this adl file, I’ve saved and loaded the newly added quantity field, maybe using this would help.
Please let me know if there are any other problems.