Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suger cipher v2.4 #688

Open
wants to merge 375 commits into
base: sugar-cipher
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
375 commits
Select commit Hold shift + click to select a range
45dce3f
Add findById string array tests
whoshuu Apr 1, 2015
411ce64
Use gradlew do a connectivity check
whoshuu Apr 2, 2015
3e0ad6b
Adding first and last helpers for record retrieval
cdesch Mar 31, 2015
7e8590a
Adding tests for Helper methods first and last
cdesch Mar 31, 2015
bc5c29f
Fixing Helper Method
cdesch Mar 31, 2015
f5cdd39
Fixing first/last Helper Test Cases
cdesch Mar 31, 2015
04bc488
Fixing helper methods and test cases
cdesch Apr 1, 2015
f69895b
Expand tests and some minor cleanup
whoshuu Apr 2, 2015
189c2bc
Support querying for null values
neilw4 Apr 1, 2015
6bea27c
Test queries for null values
neilw4 Apr 1, 2015
9fabcc1
Update ReflectionUtil.java to handle byte[] storage and retrieving
andresteves Nov 20, 2014
95bde0b
Add byte array models and tests
whoshuu Apr 4, 2015
384b31d
Update sugar.iml
whoshuu Apr 4, 2015
9ee2553
Add support to BigDecimal data type
diasrafael Jul 11, 2014
5504559
Add BigDecimal models and tests
whoshuu Apr 4, 2015
31dd0f3
Add classes to the libraryJar task
whoshuu Apr 7, 2015
c99cd8b
Add tests for saving models multiple times
whoshuu Apr 7, 2015
6736197
Use a map to keep track of annotated entities and their sugar id values
jivimberg Jan 31, 2015
0fdc4dd
Properly obtain the id from a foreign key model
jivimberg Jan 31, 2015
1f49d7c
Fixed remaining annotated id issue
whoshuu Apr 7, 2015
95eb367
Stop SugarRecord from interacting with other libs
nosrak113 Feb 4, 2015
076043a
Fixed a bug when saving a row that was already in the db.
Apr 11, 2015
4cb3154
Use normal gradle instead of the wrapper to bypass build errors when …
whoshuu Apr 11, 2015
5884ddd
Remove unused activities
whoshuu Apr 11, 2015
2bea797
Remove unused models and poor test
whoshuu Apr 11, 2015
d72161c
Enums serialize using .name()
benohalloran Apr 10, 2015
ec8573e
Add basic tests for enums with overriden and default toString methods
benohalloran Apr 10, 2015
a45dd1a
Update SugarRecord to return sensible values on multiple operations
Shyish Apr 6, 2015
ec0b465
Cursors for adapters
benohalloran Apr 16, 2015
e0077a2
Add Test, Consistency update
benohalloran Apr 16, 2015
ff29934
Fix StrictMode crashes by calling `close` on our DexFiles
abscondment Apr 17, 2015
b03f5b9
Update readme Gradle dependency version
victorhaggqvist May 9, 2015
85d5f3e
Merge pull request #325 from victorhaggqvist/patch-1
satyan May 9, 2015
72dfc88
Update ReflectionUtil.java
tracytheron May 11, 2015
a66d610
Update ReflectionUtil.java
tracytheron May 11, 2015
d75766c
Update ReflectionUtil.java
tracytheron May 12, 2015
ebdcb3c
Merge pull request #314 from madrona-labs/fix-strictmode
satyan Jul 1, 2015
2a3e292
maven publish configuration
Jul 6, 2015
0150451
maven publish configuration
Jul 6, 2015
05051a2
Catching Throwable instead of ClassNotFoundException because Class.fo…
mitchyboy9 Jul 27, 2015
19126d6
how to use existing database
salimkamboh Aug 6, 2015
d15dff5
Fixed issue with database upgrade when MultiDex support is enabled.
bendaniel10 Oct 13, 2015
963716e
Merge pull request #373 from salimkamboh/create-if-not-exists
sibelius Oct 16, 2015
8eeaebe
cleaned Select from hardcoded Strings
RoyMontoya Oct 16, 2015
d038f6c
revert change on whereCond name
RoyMontoya Oct 16, 2015
da0a7a6
added test
RoyMontoya Oct 20, 2015
3cc5cf1
format fix
RoyMontoya Oct 20, 2015
25b9868
merge select-cleanup to test-fix
RoyMontoya Oct 20, 2015
4b08bf4
Merge pull request #1 from RoyMontoya/test-fix
RoyMontoya Oct 20, 2015
547c816
added group_by to toSQL
RoyMontoya Oct 20, 2015
30c3900
Schema cleanup
RoyMontoya Oct 26, 2015
4d5e420
Merge remote-tracking branch 'satyan/master'
tracytheron Oct 27, 2015
563738c
fix merge
tracytheron Oct 27, 2015
ed73852
Merge pull request #327 from tracytheron/master
sibelius Oct 27, 2015
9aa3b3e
fixed conflicts
RoyMontoya Oct 26, 2015
bd1ba7b
fixed conflicts
RoyMontoya Oct 27, 2015
0585792
added getSugarDatabase to simplify Database calls
RoyMontoya Oct 27, 2015
ef0445f
Merge pull request #410 from RoyMontoya/SugarRecord
sibelius Oct 28, 2015
f5ca5e3
Add MultiColumn Unique Table constraint support
alfmatos Sep 25, 2015
98f8df5
Filtered classes by DOMAIN_PACKAGE_NAME
Oct 28, 2015
8279d8b
Merge pull request #408 from RoyMontoya/SchemaGenerator
sibelius Nov 4, 2015
c58fcf5
upgrading to roboeletric 3.0
sibelius Nov 4, 2015
d77bc11
update travis to android 23
sibelius Nov 4, 2015
bed0975
moving changelog from README to CHANGELOG.md
sibelius Nov 12, 2015
11e8d74
Merge pull request #423 from satyan/feature/changelog
sibelius Nov 12, 2015
a0baa82
updating to android-23, travis doesn't support it yet
sibelius Nov 19, 2015
d73bafe
Merge pull request #430 from satyan/feature/roboeletric3.0
sibelius Nov 19, 2015
3fd1f30
fix satyan/sugar#155 from pull request, bumping sugar to version 2.0 …
sibelius Nov 19, 2015
903a0e0
Merge branch 'benohalloran-master'
sibelius Nov 19, 2015
dea3017
Update version
NikolayKul Nov 22, 2015
0c2de55
complete CHANGELOG for version 1.4
sibelius Nov 23, 2015
b2eb8db
adding unreleased changes to changelog
sibelius Nov 23, 2015
e74a88b
fix satyan/sugar#267
sibelius Nov 23, 2015
91fb4f5
Merge branch 'bendaniel10-master'
sibelius Nov 23, 2015
022f7d2
update changelog
sibelius Nov 23, 2015
fa7e6e4
removing appcompat library, fix satyan/sugar#276
sibelius Nov 25, 2015
7b98a7c
Removing guava
dnalves Nov 25, 2015
3e9d453
Reverting iml file.
Nov 25, 2015
520b030
Merge pull request #437 from dnalves/removingGuava
sibelius Nov 25, 2015
e4e13be
updating changelog
sibelius Nov 25, 2015
820f1ad
Version number invalid
nursultanturdaliev Nov 29, 2015
f1eddff
Merge pull request #440 from nurolopher/patch-1
sibelius Nov 29, 2015
1d6f3ef
fix Travis CI build for Build Tools 23.0.2
cjrd Nov 30, 2015
17694c4
Merge pull request #441 from cjrd/master
sibelius Nov 30, 2015
04429a4
Merge pull request #432 from Nec1ord/patch-1
sibelius Nov 30, 2015
09034cb
add update based on unique values and improve readme
sibelius Dec 1, 2015
3e0ac29
enable update on instance
sibelius Dec 1, 2015
7e451bc
Merge pull request #449 from satyan/feature/updateInTx
sibelius Dec 1, 2015
3a507b2
save record when update fails
sibelius Dec 1, 2015
d099ab3
Merge pull request #450 from satyan/feature/update_like_insert_update
sibelius Dec 1, 2015
d75c4de
Merge pull request #400 from RoyMontoya/select-cleanup
sibelius Dec 2, 2015
3d77449
refactor SchemaGenerator and adding some tests
sibelius Dec 2, 2015
e8ad00a
Merge pull request #451 from satyan/feature/testSchemaGenerator
sibelius Dec 2, 2015
171e14d
MultiUnique DSL to multicolumn table unique constraint
sibelius Dec 2, 2015
92f50f4
Merge branch 'alfmatos-master'
sibelius Dec 2, 2015
b8ad309
Add Gitter badge
gitter-badger Dec 2, 2015
a12d27a
Merge pull request #452 from gitter-badger/gitter-badge
sibelius Dec 2, 2015
7401679
update README.md
sibelius Dec 3, 2015
91ff7e6
Merge branch 'master' of github.com:satyan/sugar
sibelius Dec 3, 2015
93c2161
warn developer to upgrade database on missing colName
sibelius Dec 3, 2015
cf5f265
Merge pull request #453 from satyan/feature/warningOnMissingColumn
sibelius Dec 3, 2015
243ee4f
Travis
Dec 3, 2015
80baa64
travis error
nursultanturdaliev Dec 3, 2015
9e5d001
Jacoco
nursultanturdaliev Dec 3, 2015
a6f9bfc
Jacoco
nursultanturdaliev Dec 3, 2015
2a014a5
Travis Build fix
nursultanturdaliev Dec 3, 2015
1624af3
Travis Build fix
nursultanturdaliev Dec 3, 2015
2753947
Travis Build fix
nursultanturdaliev Dec 3, 2015
f64b71b
Travis Build fix
nursultanturdaliev Dec 3, 2015
3261371
Travis Build fix
nursultanturdaliev Dec 3, 2015
75db4fb
Travis Build fix
nursultanturdaliev Dec 3, 2015
f476390
Travis Build fix
nursultanturdaliev Dec 3, 2015
e7983f5
Travis Build fix
nursultanturdaliev Dec 3, 2015
1c9ca0d
Travis Build fix
nursultanturdaliev Dec 3, 2015
5761057
Travis Build fix
nursultanturdaliev Dec 3, 2015
d007a2f
Travis Build fix
nursultanturdaliev Dec 3, 2015
fdae8e7
Travis Build fix
nursultanturdaliev Dec 3, 2015
b087e0c
Travis Build fix
nursultanturdaliev Dec 3, 2015
0b138f6
Merge pull request #455 from nurolopher/master
sibelius Dec 3, 2015
9489846
JacocoReportTest
nursultanturdaliev Dec 4, 2015
0004c12
Merge pull request #457 from nurolopher/master
sibelius Dec 4, 2015
4d2df14
Multiline and single line comments on sql migration files.
nursultanturdaliev Dec 4, 2015
79bd040
Logging
nursultanturdaliev Dec 4, 2015
71444db
Merge pull request #459 from nurolopher/master
sibelius Dec 5, 2015
d06aafc
Removed unused imports and redundant variable value assignments.
nursultanturdaliev Dec 5, 2015
f8eb02e
Merge pull request #460 from nurolopher/master
sibelius Dec 6, 2015
7f881a8
Merge pull request #362 from mitchyboy9/master
sibelius Dec 7, 2015
297a838
removing static from callback interface
sibelius Dec 11, 2015
def9904
removing unique for auto generated add columns migrations
sibelius Dec 11, 2015
eed22a6
Merge branch 'jedld-master'
sibelius Dec 11, 2015
8156895
fix satyan/sugar#467
sibelius Dec 14, 2015
fff7ae0
fix executeScript on SchemaGenerator
sibelius Dec 14, 2015
9f371b3
update README, documentation is updated
sibelius Dec 14, 2015
7b210e1
Added retrolambda in classloader class lookup in ReflectionUtil.java
tkhduracell Jan 1, 2016
b183746
Merge pull request #486 from tkhduracell/fix-retrolamda
sibelius Jan 2, 2016
416df04
Fixing migration to single dex after multidex.
Jan 7, 2016
b461c0d
Merge pull request #492 from dnalves/fixingMultidexToSingle
sibelius Jan 7, 2016
5690f92
Added the @Target annotation for compile-time error checking.
tevjef Jan 12, 2016
3de393c
Merge pull request #498 from tevjef/master
sibelius Jan 12, 2016
5924594
added syntax highlighting in readme
hellerve Jan 21, 2016
1d944a2
Merge pull request #505 from hellerve/master
sibelius Jan 21, 2016
fafe384
Update README.md
enyciaa Feb 12, 2016
a975ec9
Merge pull request #521 from enyciaa/patch-1
sibelius Feb 12, 2016
473820e
Update CHANGELOG.md
sibelius Mar 7, 2016
1ca7267
Update README.md
sibelius Mar 7, 2016
784b3da
add save/update/delete usage for @Table annotations
redgetan Mar 18, 2016
a9d4b41
Merge pull request #547 from redgetan/master
sibelius Mar 19, 2016
fc285ac
change the type of the args list to String
fhernandezn Mar 24, 2016
8ee7cf3
Merge pull request #551 from frankweb/simplify-convert-args-method
sibelius Mar 28, 2016
619b5db
adding codetriage to sugar
sibelius Mar 28, 2016
941bd36
find works with true/false
egrado Mar 29, 2016
2358dae
removing iml from repo
sibelius Mar 31, 2016
ed4c817
add sqlite keywords support
Mar 31, 2016
8b80057
fix error
Apr 1, 2016
37bef8f
fix error
Apr 1, 2016
a0dc1cc
change list and output
Apr 2, 2016
55c125d
Merge pull request #557 from geracervantes/master
Apr 2, 2016
b9d826c
Make SugarContext getSugarDb public
Apr 2, 2016
ea76217
Changes in Select.java:
Apr 2, 2016
5007b36
Merge pull request #562 from JonatanSalas/master
Apr 2, 2016
4a5cbb5
General project update:
Apr 4, 2016
331f61c
Updated example app build.gradle file app-compat dependency
Apr 4, 2016
a814f31
Updated travis.yml buildTools version to 23.0.3
Apr 4, 2016
e776a3e
Added two test to keep coverage
Apr 4, 2016
94f296f
Minimal modifications in KeyWordUtil
Apr 4, 2016
cb84ec2
Merge pull request #563 from JonatanSalas/master
Apr 4, 2016
fbd7475
Merge pull request #553 from egrado/master
Apr 5, 2016
92301ea
Add Instant Run support
firaskafri Apr 5, 2016
e5d80b5
Merge pull request #564 from firasalkafri/master
sibelius Apr 5, 2016
519c83d
Class not found in getDomainClass https://github.com/satyan/sugar/iss…
Apr 5, 2016
ae9ca55
Merge pull request #565 from lupsyn/feature/application-context-fixing
Apr 5, 2016
86cd849
Remove unnecessary console spam, as result: speed up + 20-30%
Apr 6, 2016
02e15ed
Update SugarContext.java
Rexee Apr 6, 2016
233a6f9
moved to ManifestHelper
Rexee Apr 6, 2016
488c6b0
Update SugarRecord.java
Rexee Apr 6, 2016
e6752ac
Update SugarRecord.java
Rexee Apr 6, 2016
c81685c
Update ManifestHelper.java
Rexee Apr 6, 2016
a85264f
Update ManifestHelperTest.java
Rexee Apr 6, 2016
f025692
Update SugarContext.java
Rexee Apr 6, 2016
d630e39
Update ManifestHelper.java
Rexee Apr 6, 2016
0d3bed9
Update SugarContext.java
Rexee Apr 6, 2016
b16e653
Merge pull request #568 from Rexee/master
Apr 6, 2016
a4c94ef
Project Update:
Apr 6, 2016
795da2c
Project update:
Apr 6, 2016
46321ab
Added more Test methods to NamingHelperTest class
Apr 6, 2016
bb674ee
Start migration of test to library in order to increment coverage.
Apr 8, 2016
602e61f
Start migration of test to library in order to increment coverage.
Apr 8, 2016
dbcc272
Deleted DummyContext class
Apr 8, 2016
ba572f9
Added NumberComparatorTest
Apr 8, 2016
1a600ce
Solved bug with SugarTransactionHelper
Apr 8, 2016
b6fdb8e
Added SugarDbTest
Apr 8, 2016
e4a29d1
Deleted all test and classes from sample app
Apr 9, 2016
445c63b
Added static import to replace SugarRecord class import
Apr 9, 2016
2786aaa
try to fix error with Coverrals
Apr 9, 2016
e083fd4
only checks in library, not in example
Apr 9, 2016
584e9de
Updated gradle plugin to version 2.0.0
Apr 9, 2016
9828d51
call to gradle wrapper in travis.yml
Apr 9, 2016
914ca19
call to gradle wrapper in travis.yml
Apr 9, 2016
7743c6c
Updated build.gradle files
Apr 9, 2016
6b3182c
Added Test for SugarConfig
Apr 10, 2016
c9f21a5
Added test for private constructor in KeyWordUtil
Apr 10, 2016
a8e28b2
Commented test in ReflectionUtil
Apr 10, 2016
cb51e01
Added test in ReflectionUtil
Apr 10, 2016
6557f58
Added more test in ReflectionUtil
Apr 10, 2016
29fe48c
Added more test to ReflectionUtil
Apr 10, 2016
de7c38b
Added more tests to com.orm test package
Apr 10, 2016
3831f3f
Added more test to SchemaGeneratorTest
Apr 11, 2016
eede8a5
Solved error in ReflectionUtilTest
Apr 11, 2016
dec896a
Merge pull request #569 from JonatanSalas/master
Apr 11, 2016
e2396b0
add method afterTableCreated that executes a sql file with the name o…
Apr 13, 2016
f2ff627
refactoting executeScriptFile to receive a path that could be sugar_u…
Apr 13, 2016
4eb17aa
Updated build.gradle files to add support for RetroLambda
Apr 16, 2016
23587ee
Added delete, delete with params and deleteAll methods
Apr 16, 2016
f2bca5b
Deleted all future.isDone calls
Apr 17, 2016
776a33c
Added more tests to SugarDataSourceTest
Apr 17, 2016
cd1949b
Extracted retrolambda because of travis CI troubleshooting around JAV…
Apr 17, 2016
c7d3961
Added bulkInsert method
Apr 17, 2016
a716a34
Added class documentation
Apr 17, 2016
b85f226
Added more test
Apr 17, 2016
ae23fa6
modified count method
Apr 17, 2016
badf546
Added test to UpdateInTx
Apr 17, 2016
4059753
Added Interfaces documentation
Apr 17, 2016
d9bceb0
Added ThreadUtil documentation
Apr 17, 2016
7f60eb9
Deleted all null assigns
Apr 17, 2016
ce7d802
Merge pull request #577 from marcusbalbi/master
Apr 21, 2016
92b675e
Implement SugarRecord.sum()
SiebelsTim May 14, 2016
f43255f
Add tests for sum()
SiebelsTim May 16, 2016
dabff00
Make SugarRecord API more versatile
SiebelsTim May 16, 2016
59a2a91
Improve API
SiebelsTim May 16, 2016
0ada490
adding missing info of how to use master version
sibelius May 16, 2016
af9abfa
using ManifestHelper.isDebugEnabled() to disable logs based on meta-d…
sibelius Jun 16, 2016
8a4cd58
Merge pull request #600 from SiebelsTim/impl-sum
sibelius Jun 24, 2016
7434b98
Merge pull request #580 from JonatanSalas/master
sibelius Jun 24, 2016
5f3c63d
Added OneToMany relation support.
Vookash Aug 3, 2016
96c843a
Refactored sugar record inflation.
Vookash Aug 3, 2016
463bf3e
Refactored ObjectInflater name.
Vookash Aug 18, 2016
0f466d7
Improved tests.
Vookash Aug 18, 2016
1ca3ecc
Improved tests.
Vookash Aug 18, 2016
e93b2f1
Fixed NamingHelperTest.
Vookash Aug 22, 2016
cbd08b4
Improved tests and logging.
Vookash Aug 27, 2016
cdaefd4
Merge pull request #659 from Vookash/master
sibelius Sep 2, 2016
ca5dd14
Merge pull request #602 from SiebelsTim/improve-api
sibelius Sep 2, 2016
d502791
Merge pull request #1 from satyan/master
RossinesP Oct 6, 2016
b800c4a
* The @MultiUnique annotation is now inherited, so that we can use it…
Oct 6, 2016
cb45742
Merge pull request #681 from RossinesP/master
sibelius Oct 6, 2016
3c8a57b
1st Commit
Oct 26, 2016
1c19a7d
-Update grade build tools version
Oct 27, 2016
1490872
Update README.md
Oct 27, 2016
b1c1f0e
Correctly it is sugar v2.4
Oct 27, 2016
425999c
Update README
Oct 27, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 43 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
library/bin
library/gen
library/.project
library/.classpath
.DS_Store

# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Eclipse project files
.classpath
.project

*.a
*.dylib
*.log
*.o
*.pot
*.pyc
*.pydevproject
*.so
*.suo
*.xcworkspace
*_ReSharper*

.DS_Store
._.DS_Store

project.properties

.settings
build/
.gradle/
.idea
*.iml
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
language: android
jdk: oraclejdk7

env:
global:
- TERM=dumb
android:
components:
- sys-img-armeabi-v7a-android-23
- tools
- build-tools-23.0.3
- android-23
- extra-android-m2repository
before_script:
- sudo service postgresql stop || true
- sudo service mysql stop || true
- sudo service memcached stop || true
- sudo service bootlogd stop || true
- sudo service elasticsearch stop || true
- sudo service mongodb stop || true
- sudo service neo4j stop || true
- sudo service cassandra stop || true
- sudo service riak stop || true
- sudo service rsync stop || true
- sudo service x11-common stop || true
script:
- ./gradlew clean build connectedCheck coveralls

cache:
directories:
- $HOME/.m2
94 changes: 94 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Sugar Releases

## [Unreleased]


## v1.5
### Added
* [#328](https://github.com/satyan/sugar/pull/328) @jedid auto add new columns during database upgrade, fix [#299](https://github.com/satyan/sugar/issues/299) and [#151](https://github.com/satyan/sugar/issues/151)
* [#389](https://github.com/satyan/sugar/pull/389) @alfmatos MultiUnique DSL to handle MultiColumn Unique Table constraint
* @sibeliusseraphini update, updateInTx methods based on Unique values of SugarRecord
* [#155](https://github.com/satyan/sugar/issues/155) @benohalloran adding Cursors for Cursor Adapters [Pull 312](https://github.com/satyan/sugar/pull/312)
* [#430](https://github.com/satyan/sugar/pull/430) @sibeliusseraphini update to roboelectric 3.0 and target android-32

### Changed
* [#437](https://github.com/satyan/sugar/pull/437) @dnalves removing guava dependency, using synchronized WeakHashMap instead
* [#423](https://github.com/satyan/sugar/pull/423) @sibeliusseraphini moving changelog of README.md to CHANGELOG.md

### Fixed
* [#362](https://github.com/satyan/sugar/pull/362) @mitchyboy9 fixed NoClassDefFoundError
* [#455](https://github.com/satyan/sugar/pull/455) @nurolopher fixed travis and coveralls config
* [#434](https://github.com/satyan/sugar/pull/434) @bendaniel10 fix multi-dex
* [#410](https://github.com/satyan/sugar/pull/410) [#408](https://github.com/satyan/sugar/pull/408) @RoyMontoya simplify code
* [#327](https://github.com/satyan/sugar/pull/327) @tracytheron support multi-dex
* [#373](https://github.com/satyan/sugar/pull/373) @salimkamboh use existing tables

## v1.4
### Added
* [#306](https://github.com/satyan/sugar/pull/306) @Shyish return boolean/integer on delete methods
* [#304](https://github.com/satyan/sugar/pull/304) @benohalloran add support to enum type
* [#197](https://github.com/satyan/sugar/pull/197) @andresteves add suport for bytes[]
* [#293](https://github.com/satyan/sugar/pull/293) @neilw4 support NULL in queries
* [#273](https://github.com/satyan/sugar/pull/273) @dominicwong617 findById support an array of ids
* [#246](https://github.com/satyan/sugar/pull/246) @kwf2030 use sqlite\_master to check whether table already exist
* [#253](https://github.com/satyan/sugar/pull/202) @JeroenMols add bulk delete
* [#285](https://github.com/satyan/sugar/pull/202) @Shyish add listAll with orderBy param
* No need to extend SugarApp - just call SugarContext.init(Context) instead
* [#129](https://github.com/satyan/sugar/pull/129) @satyan support sugar entities using @Table annotations

### Fixed
* [#314](https://github.com/satyan/sugar/pull/314) @abscondment fix StrictMode DexFile
* [#303](https://github.com/satyan/sugar/pull/303) @RossinesP fixed saving row string bug
* [#258](https://github.com/satyan/sugar/pull/258) @nosrak113 change SugarRecord ID to private to not conflit with other libraries
* [#254](https://github.com/satyan/sugar/pull/254) @jivimberg use weak keys to keep track of annotated entities
* [#215](https://github.com/satyan/sugar/issues/215) @jivimberg fix bug persisting relationship
* [#185](https://github.com/satyan/sugar/issues/185) [#243](https://github.com/satyan/sugar/issues/243) @whoshuu fix save and update method
* [#202](https://github.com/satyan/sugar/pull/202) @allieus improve getDomainsClass()
* [#104](https://github.com/satyan/sugar/issues/104) @whoshuu fix nesting "and" and "or"

## v1.4 Beta [[jar](https://github.com/satyan/sugar/releases/download/v1.4_beta/sugar-1.4_beta.jar)]
### Added
* [#112](https://github.com/satyan/sugar/pull/112) @androdevcafe added Unique and NotNull annotations
* [#78](https://github.com/satyan/sugar/pull/78) @HiddenCleverde capability to specify primary key

### Fixed
* [#113](https://github.com/satyan/sugar/pull/113) @whoshuu override findById to support int
* [#106](https://github.com/satyan/sugar/issues/106) @whoshuu add documentation to onTerminate
* [#54](https://github.com/satyan/sugar/issues/54) @whoshuu simplify count interface
* [#43](https://github.com/satyan/sugar/issues/43) @whoshuu return id on save
* [#72](https://github.com/satyan/sugar/issues/72) @whoshuu allow null values to Date and Calendar objects
* [#96](https://github.com/satyan/sugar/issues/96) @whoshuu roboeletric fallback

## v1.3 [[jar](https://github.com/satyan/sugar/releases/download/v1.3/sugar-1.3.jar)]

- Transaction Support
- Bulk Insert of records
- Encrypted datastore (branch : sugar-cipher using sqlcipher)
- Removed Constructor with context parameter. Needs default constructor now.
- Enhancements to QueryBuilder
- Bug fixes and other improvements.

## v1.2 [[jar](https://github.com/satyan/sugar/releases/download/v1.2/sugar-1.2.jar)]

- package restriction for domain classes.
- metadata caching
- QueryBuilder v1
- Database Migrations
- Provision for Raw queries
- Better and more organized api guide and usage instructions.

## v1.1 [[jar](https://github.com/satyan/sugar/releases/download/v1.1/sugar-1.1.jar)]

- Static api doesn't take context anymore. Hence

```java
Book.findById(context, Book.class, 1);
```

becomes

```java
Book.findById(Book.class, 1);
```

- Some cleanup in the code.
166 changes: 146 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,160 @@
Please follow the documentation at
http://satyan.github.io/sugar
#Sugar Cipher using Sugar ORM v2.4
by Ethan Tam(sbhkin)

The example application is provided in the "example" folder in the source.

- Extract the libs and assets into your application. This dependency is not included in the sugar library.
- Clone this branch to you Project root folder
- Follow [How to use master version](#usemasterv)
- Add a meta property named DB_PASSWORD in your manifest file along with other Sugar configuration as follows:
```
<meta-data
android:name="DB_PASSWORD"
android:value="your_DB_ENCRYPTION_KEY_here"/>
```

# Getting Started:
You're good to go. Use Sugar as usual and your database is encrypted now.

Sugar is now available as a library project also. Add it to your project and utilize the latest changes.
The project is available in the folder "library"
http://developer.android.com/tools/projects/index.html#LibraryProjects
# Sugar ORM

# New in version 1.2
### <a link = "usemasterv"></a>How to use master version
First, download sugar repository
```
git clone git@github.com:satyan/sugar.git
```

1. package restriction for domain classes.
2. metadata caching
3. QueryBuilder v1
4. Database Migrations
5. Provision for Raw queries
6. Better and more organized api guide and usage instructions.
include this in your **settings.gradle**
```gradle
include ':app' // your module app
include ':sugar'

# What's new in 1.1:
def getLocalProperty(prop) {
Properties properties = new Properties()
properties.load(new File(rootDir.absolutePath + '/local.properties').newDataInputStream())
return properties.getProperty(prop, '')
}

1. Static api doesn't take context anymore. Hence
project(':sugar').projectDir = new File(getLocalProperty('sugar.dir'))

Book.findById(context, Book.class, 1);
```

becomes
include this in your **local.properties**
```
sugar.dir=/path/to/sugar/library
```

Book.findById(Book.class, 1);
add sugar project to the dependencies of your main project (build.gradle)
```gradle
dependencies {
compile project(':sugar')
}
```

You should also comment this line just comment this line (library/build.gradle): https://github.com/satyan/sugar/blob/master/library%2Fbuild.gradle#L2

2. Some cleanup in the code.
```gradle
// apply from: '../maven_push.gradle'
```
===================

After installing, check out how to set up your first database and models [here](http://satyan.github.io/sugar/getting-started.html) **Outdated**. Check examples of 1.4 and master below:

## Examples
### SugarRecord
```java
public class Book extends SugarRecord {
@Unique
String isbn;
String title;
String edition;

// Default constructor is necessary for SugarRecord
public Book() {

}

public Book(String isbn, String title, String edition) {
this.isbn = isbn;
this.title = title;
this.edition = edition;
}
}
```
or
```java
@Table
public class Book { ... }
```

### Save Entity
```java
Book book = new Book("isbn123", "Title here", "2nd edition")
book.save();
```

or
```java
SugarRecord.save(book); // if using the @Table annotation
```

### Load Entity
```java
Book book = Book.findById(Book.class, 1);
```

### Update Entity
```java
Book book = Book.findById(Book.class, 1);
book.title = "updated title here"; // modify the values
book.edition = "3rd edition";
book.save(); // updates the previous entry with new values.
```


### Delete Entity
```java
Book book = Book.findById(Book.class, 1);
book.delete();
```

or
```java
SugarRecord.delete(book); // if using the @Table annotation
```

### Update Entity based on Unique values
```java
Book book = new Book("isbn123", "Title here", "2nd edition")
book.save();

// Update book with isbn123
Book sameBook = new Book("isbn123", "New Title", "5th edition")
sameBook.update();

book.getId() == sameBook.getId(); // true
```

or
```java
SugarRecord.update(sameBook); // if using the @Table annotation
```

### Bulk Insert
```java
List<Book> books = new ArrayList<>();
books.add(new Book("isbn123", "Title here", "2nd edition"))
books.add(new Book("isbn456", "Title here 2", "3nd edition"))
books.add(new Book("isbn789", "Title here 3", "4nd edition"))
SugarRecord.saveInTx(books);
```

### When using ProGuard
```java
# Ensures entities remain un-obfuscated so table and columns are named correctly
-keep class com.yourpackage.yourapp.domainclasspackage.** { *; }
```

## [CHANGELOG](https://github.com/satyan/sugar/blob/master/CHANGELOG.md)

## Contributing

Please fork this repository and contribute back using [pull requests](https://github.com/satyan/sugar/pulls). Features can be requested using [issues](https://github.com/satyan/sugar/issues). All code, comments, and critiques are greatly appreciated.
Loading