Android ORM framework ActiveAndroid
1. In AndroidManifest. xml, we need to add these two
AA_DB_NAME (Database name, which cannot be changed, but is optional. If this parameter is left blank, It is the default value of Application. db)
AA_DB_VERSION (the database version number is also optional-the default value is 1)
...
2. initialize In the first Activity or application
3. To create an object class, you must inherit from the Model. Use @ Table (name = table_name) to indicate the Table bound to the object class and use @ Column (name = Category) to identify the field name.
For example:
@ Table (name = table_name)
Public class Category extends Model {
@ Column (name = Name)
Public String name;
}
4. Operations
Model class comes with save () call to save
Select class included in the Framework
For example, new Select (). form (Category. class). execute () is a chained programming. You can view it on your own.
The built-in delete instance of the Framework is no longer provided. You can view it by yourself.
5. Database Upgrade
Change the database version AA_DB_VERSION in AndroidManifest. xml
Create an SQL file and directory structure (/migrations/version number after upgrade. SQL) in the assest directory. You need to write the SQL statement for changing the database (one SQL statement in one line) in the file)
Corresponding field added to the Category object