objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
1.04k stars 120 forks source link

Generate separate code file for each entity #525

Open fifteenjoy opened 1 year ago

fifteenjoy commented 1 year ago

Is it possible that Generator generat binding code to different file according Entity file instead of only one file "objectbox.g.dart"

I have many entity files in my project. I would like to generate binding code to different file according Entity file. lIke below example generate "_bp_statusdto.g.dart" for entity file "_bp_statusdto.dart", generate "_company_infodto.g.dart" for entity file " _company_infodto.dart"

WeChat Image_20230331170427

Basic info: ObjectBox and ObjectBox generator version: 2.0.0 Flutter/Dart SDK: 3.0.0

greenrobot-team commented 1 year ago

This is currently not possible. Thank you for your request!

Is there any e.g. technical reason why you need this?

For others interested, please thumbs up the first post!

fifteenjoy commented 1 year ago

Thanks for your reply. I just think if I have many entities, objectbox.g.dart will get huge, it is a little bit inconvinent to read these code. the generated code from the sceenshot in my first post is from package "json_serializable", I prefer to its way.