Академический Документы
Профессиональный Документы
Культура Документы
4 (https://github.com/idoamram/SimpLite/stargazers?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=4900) 2
(https://github.com/idoamram/SimpLite/watchers?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=4900) 3
(https://github.com/idoamram/SimpLite/network?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=4900) 0
(https://github.com/idoamram/SimpLite/issues?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=4900)
(https://facebook.com/sharer.php?
General u=https://android-
Category
arsenal.com/details/1/4900)
Free (/free)
Tag
(https://twitter.com/intent/twe
arsenal.com/details/1/4900&text=The%20An
ORM (/tag/69)
License %20ORM%20-%20SimpLite
Apache License, Version 2.0 (http://opensource.org/licenses/Apache-2.0?utm_source=android-arsenal.co
(http://news.ycombinator.com/submitlink
m&utm_medium=referral&utm_campaign=4900)
arsenal.com/details/1/4900&t=The%20Andro
Min SDK
16 (Android 4.1 Jelly Bean) (/api?level=16)
Registered
%20ORM%
Dec 19, 2016
Favorites
(https://plus.google.com/share?
1 url=https://android-
Link arsenal.com/details/1/4900)
https://github.com/idoamram/SimpLite/ (https://github.com/idoamram/SimpLite/?utm_source=android-arse
(https://reddit.com/subm
nal.com&utm_medium=referral&utm_campaign=4900)
arsenal.com/details/1/4900&title=The%20An
See also
Orma (/details/1/2875)
Torch (/details/1/338) %20OR
DBFlow (/details/1/1134)
Ollie (/details/1/1037)
Storm (/details/1/5559)
Additional
Language
Java
Version
N/A (https://github.com/idoamram/SimpLite/releases?utm_source=android-arsenal.com&utm_medium=re
ferral&utm_campaign=4900)
Created
Dec 3, 2016
Updated
Dec 26, 2016 (Retired)
Owner
idoamram (/user/idoamram)
Contributor
1 (https://github.com/idoamram/SimpLite/graphs/contributors?utm_source=android-arsenal.com&utm_me
dium=referral&utm_campaign=4900)
Activity
Badge
Generate
Download
Source code
Commercial
SimpLite
Usage
compile 'com.simplite:simplite-orm:0.9.4'
@Entity(tableName = "my_cool_entity_table_name")
public class MyCoolEntity extends DBObject
###3. Add meta-data to your manifest Name | Type | Value | Default value ---- | ---- | ----- | ------------
- DATABASE_NAME | String | <DATABASE_FILE_NAME> | default_db DATABASE_VERSION |
Number | <CURRENT_DATABASE_VERSION> | 1 CONFIG_CLASS | String |
<FULL_CONIFGURATION_CLASS_NAME> | null ENTITIES_CLASSES_NAME | String array |
<FULL_CLASS_NAMES_ARRAY> | []
Exmaple
Example
#####CONFIG_CLASS You MUST specify the FULL name, including all packages. The
configuration class MUST implement the SimpLiteConfiguration interface. It has
beforeOnCreate, afterOnCreate ,beforeOnUpgrade, afterOnUpgrade. For saving your data during
upgrade, hold it on beforeOnUpgrade, and insert it on afterOnCreate.
Example
<meta-data android:name="CONFIG_CLASS" android:value="com.simplite.example.utils.LocalDBCon
#####ENTITIES_CLASSES_NAME The FULL (include all packages) name of each class that
represent an entity (table in the database). An Entity MUST extend from DBObject class. The
entities should separate with a coma
###Annotations Usage
#####@Entity ######For a class that represents an entity (table) in the database Method |
Expected Value ------ | -------------- tableName | The name of the table that this entity represents
#####@PrimaryKey ######For a field that is a primary key in its table. Method | Expected Value --
---- | -------------- columnName | The name of the column options | Options to add to the column, like
AUTOINCREMENT or UNIQUE
#####@Column ######For any field that is a regular column - not primary or foreign key Method |
Expected Value ------ | -------------- name | The name of the column options | Options to add to the
column, like AUTOINCREMENT or UNIQUE
#####@ForeignKey ######For any field that is an instance of other entity Method | Expected
Value ------ | -------------- valueColumnName | The name of the column in the current table
fkColumnName | The name of the column in the foreign table entityClass | The foreign entity
class options | Options to add to the column, like AUTOINCREMENT or UNIQUE
CRUD
#####Create
person.create()
#####Delete
person.delete()
#####Update
person.save()
#####Read
findAll
findAllByColumn
findOne
findById
query
rawQuery
count
countByColumn
getAverageByColumn
#####CRUD in background Each CRUD method have another method that called
[methodName]+"InBackground"(For example: createInBackground), that execute the original
method in an AsyncTask.
###SQL helpers Return string that is a CREATE TABLE command for a class.
getCreateTableCommand
Return string that is an INSERT command for a class instance, including the current fields values.
getInsertCommand
Return string that is an UPDATE command for a class instance, including the current fields
values.
getUpdateCommand
###Please feel more than FREE to contact me and give a feedback, i want to improve the library
and make it better for you. ###ido.movieditor@gmail.com (mailto:ido.movieditor@gmail.com)
Follow us on Twitter (https://twitter.com/Android_Arsenal?utm_source=android-
arsenal.com&utm_medium=referral&utm_campaign=4900)