Best practices for SQLite DB and ContentProvider

后端 未结 5 1705
借酒劲吻你
借酒劲吻你 2021-01-29 22:42

My Android app is reading and writing to a local SQLite DB from a few different Activities and a Service. Pretty standard. But I\'m not happy with the way I\'ve got all the DB d

5条回答
  •  北海茫月
    2021-01-29 23:07

    Just to complete the list more and more ... Another ORM is the ORM solution provided with the BARACUS Framework. It is not inteded to build enterprise sized databases, its more for storing a couple of entities in the database and make it accessible by the app. There is no codegeneration approach inside of it; you simply write your entity pojo, a rowmapper and your table def. Therefore you can make use of DAOs, Dependency Injection, IOC style lifecycle support and much more.

    ORM Features so far :

    • Lazy Loading (Collections + Lazy References)
    • CRUD operations for free
    • Query by example
    • a couple of aspects (autotimestamp etc)
    • Persistence layer lifecycle support across multiple application releases

    For the more sophisticated database stuff (using the ORM is a little bit hand work like in good old spring rowmapper time) I am currently thinking about adding ormlite integration.

    For more code details just check the tutorial application on github

提交回复
热议问题