I'm new to ObjectBox. I have a worklistDocumentNumber, from which I need to get report master data by using query. Can anyone help me with this. I tried by adding some filter conditions in query, but I'm not sure how exactly this works...
@Entity()
class ReportMaster {
int id;
String? reportName;
String? reportContent;
final workList = ToOne<WorkList>();
ReportMaster({
this.id = 0,
required this.reportName,
required this.reportContent,
});
}
@Entity()
class WorkList{
int id;
String? worklistDocumentNumber;
String? worklistStatus;
WorkList({
this.id = 0 ,
this.worklistDocumentNumber,
this.worklistStatus,
});
}
This is my Store
late final Store _store;
late final Box<ReportMaster> _reportMasterBox;
ObjectBox._init(this._store){
_reportMasterBox = Box<ReportMaster>(_store);
}
static Future<ObjectBox> init() async {
final store = await openStore();
return ObjectBox._init(store);
}
Learn something about relational database concepts, though ObjectBox depends upon NoSql. But for establishing relations, you should have know some basics, like key!
After knowing this basics, you can head over to the docs of ObjectBox, it'll be much easier than before!
For knowing the basics You can refer to,
And for ObjectBox The Official Documentation about Relations in ObjectBox