objectbox / objectbox-java

Android Database - first and fast, lightweight on-device vector database
https://objectbox.io
Apache License 2.0
4.36k stars 301 forks source link

Use Universal function to remove and Put Boxes data #997

Closed TechNov closed 2 years ago

TechNov commented 3 years ago

Hello, i want to implement an function who permit me to remove and save data from all Boxes like this:

public static void RevomeAllAndSaveAll(Box<?> objectbox, List<?> ListData) { objectbox.removeAll(); objectbox.put(ListData); } thank's.

greenrobot-team commented 3 years ago

There is BoxStore.removeAllObjects(). As for the put part I'm not sure if that would work with Java generics and BoxStore.boxFor​(java.lang.Class<T> entityClass). But you are welcome to make a suggestion!

no-response[bot] commented 2 years ago

Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue.