1. Native operation
A good way to pack in Android-------Sqlliteopenhelper
- Object-oriented operations
- Operation of SQL statements
2. Three-party operation
orm refers to object-relational mapping (Relation Mapping), which is a programming technique (both Greendao and Ormlite are based on ORM frameworks)
Used to implement transformations between data in different types of systems in an object-oriented programming language.
In effect, it actually creates a "virtual object database" that can be used in a programming language.
Object-oriented is developed from the basic Principles of software engineering (such as coupling, aggregation, encapsulation),
The relational database is developed from the mathematical theory. There is no match between the two.
ORM, as the form of project middleware, realizes data relation mapping in different scenarios.
Object-relational mapping is a technique to solve the phenomenon of non-matching between object-oriented and relational database . That's how ORM comes in .
Based on annotations and reflection, the performance of Ormlite has been lost (annotations are actually using the principle of reflection)
Advantages:
The document is more comprehensive, the community is active, has the good maintenance, the use is simple, easy to get started.
Disadvantages:
Low efficiency due to reflection
Advantages:
The efficiency is high , the insertion and update speed is twice times of SQLite, the loading entity speed is 4.5 times times ormlite.
The file is small (<100k), consumes less memory, but requires the Create Dao,
Flexible operation entities: support Get,update,delete and other operations
Disadvantages:
higher learning costs . which uses a Java project according to some properties and rules to generate some of the basic code, similar to JavaBean but there are some rules, in addition to QueryBuilder, DAO and other APIs, so first understand the whole process, in order to facilitate the use. Without ormlite that package intact, Greendao's official web site also points out that it is based on generator rather than reflection that makes it much more efficient.
Wirelessly database operations