objectbox

LocalTime range query with ObjectBox

馋奶兔 提交于 2021-01-28 02:07:13
问题 Would this work with ObjectBox? class Hub { List<Schedule> schedules; } class Schedule { String day; LocalTime opens; LocalTime closes; } And then query those Hubs which opens and closes during a specific day, say, query with this constraint: new Schedule().builder() .day("Monday") .opens(LocalTime.parse("08:00") .close(LocalTime.parse("17:00").build(); So in this case we want to query for Hubs that are open on Mondays at 8am to 5pm. How does this translate to Objectbox Query? 回答1: You can

Does ObjectBox have a SQL Like keyword equivalent

China☆狼群 提交于 2021-01-04 06:59:36
问题 I have a project that is using ObjectBox to store data locally. When I perform a query in SQL, I can use "%" to get all of the items because I am using the "Like" keyword to match patterns. Does ObjectBox have an equivalent way to do this in a query? 回答1: Not sure about the specifics about your use case, often a LIKE is used to find a string anywhere in the text. This is supported by ObjectBox using contains : List<Note> endNotes = noteBox.query().contains(Note_.text, "end").build().find();

Can I ship an android app, with a pre-populated objectbox db in it

血红的双手。 提交于 2020-06-13 05:56:28
问题 Pretty much as the title says. I want to launch my Android app, using ObjectBox, but I'd like the data to be prepopulated in the boxes. Can I package both data.mdb and lock.mdb inside the app, from data I've created during development? Or is there device specific stuff in there that will need to be generated on each specific device individually. EDIT - On checking how big my data.mdb file is it's HUGE!!! I am trying to store a dictionary of words. It has 370k 'rows' each containing a single

How to close Objectbox Store and delete data files

落花浮王杯 提交于 2019-12-22 11:36:03
问题 I'v got an exception after I call put() with my data list. I know that I closed the box before with a reason (deleteAllFiles() must be closed). How should I open it again? As I see, dataBoxStore is not null after I closed it. My code: dataBoxStore = MyObjectBox.builder().androidContext(this).name("DB").build(); dataBoxStore.close(); dataBoxStore.deleteAllFiles(); final Box<Data> areaLocationBox = dataBoxStore.boxFor(Data.class); areaLocationBox.put(myList); Exception: Caused by: java.lang