ORMLite initializes a foreign collection

I have someone else's collection field at my facility. If I create an Object> save it> query for it: then I can use it. But if I create an Object and try to immediately access someone else's collection, then it will be null. How to initialize it?

+4
source share
1 answer

Within the ORMLite class , Dao exists assignEmptyForeignCollection(...). This creates an empty collection for you and assigns it to the correct field.

To quote from Javadocs for a method :

. . , , , :

+4

Source: https://habr.com/ru/post/1545382/


All Articles