Modifying datamodel (adding a new list to dataroot) #296
-
Hello, I've also asked this question on StackOverflow, but as I need a response very quickly, I'm trying this possibility as well. I have a fully operational application on top of Microstream (with 'Customer' objects). Now I need to add a completely new class 'Vendors', but I'm stuck. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, you are right, the public List<Vendor> getVendors()
{
if(this.vendors == null)
{
this.vendors = new ArrayList<>()
}
return this.vendors;
} |
Beta Was this translation helpful? Give feedback.
Hi, you are right, the
vendors
list is not present in the storage, so the field will be initialized with its default value (null).There are several possibilities to introduce initial values to new fields.
One rather complex way would be to implement a Legacy Type Handler.
A far more simple one is just lazy initialization in your
Customer
type: