Sabres


Source link: https://github.com/tamir7/Sabres

Sabres

Sabres is an ORM library that exposes a Parse-like API.

Features

  • Schemaless: No need to define a schema for your objects. Sabres will dynamicly update schema changes.

  • Auto indexing: No need to define indices. Sabres will handle that for you.

  • No Migration: As schemas are dynamic, there are no "database versions".

  • No Sqlite: the API fully abstracts all Sqlite interfaces, while still giving you most of the functionality.

  • Simple and powerfull API: Well... everyone says that about their libraries, but don't take my word for it, just scroll down a bit.

Quick Start

Create your model by extending SabresObject.

public class Movie extends SabresObject {

  private static final String TITLE_KEY = "title";
  private static final String YEAR_KEY = "year";

public String getTitle() {

return getString(TITLE_KEY);

  
}

public void setTitle(String title) {

put(TITLE_KEY, title);

  
}

public Short getYear() {

return getShort(YEAR_KEY);

  
}

public void setYear(Short year) {

put(YEAR_KEY, year);

  
}

Initialize Sabres and register your model classes.

public class MyApplication extends Application {

@Override
  public void onCreate() {

super.onCreate();

SabresObject.registerSubclass(Movie.class);

Sabres.initialize(this);

  
}

Create a new Movie object and save it to Sabres:

Movie movie = new Movie();
 movie.setTitle("Fight Club");
 movie.setYear(1999);
 movie.saveInBackground(new SaveCallback() {

  @Override
  public void done(SabresException e) {

if (e == null) {

 // save was successful

}
 else {

 // Save failed 

}

 
}
 
}
);

Query the Sabres Database with the SabresQuery object:

  SabresQuery<Movie> query = SabresQuery.getQuery(Movie.class);

query.whereEqualTo(TITLE_KEY, title);

query.findInBackground(new FindCallback<Movie>() {

  @Override

  public void done(List<Movie> objects, SabresException e) {

  if (e == null) {

if (objects.isEmpty()) {

 // did not find any objects matching query

}
 else {

 // found some objects

}

  
}
 else {

// query failed.

  
}
 
}
);

Please see Wiki for full documentation or Javadoc for... well.. for Javadoc.

Installation

 compile ('com.sabres:sabres:0.9.18@aar') {

transitive = true;  
}

License

Copyright 2015 Tamir Shomer  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

A small Shared Preference library for Android.

Multi photo picker is totally custom library. User can add multiple picture with same photo multiple time.

Multi photo picker has best sorting option for sort by name, date and size.

Multi photo picker display album list and photos gallery it is easy to add photos in list.

Intellij Plugin to generate Pojo class from json.

Let Retrofit support multiple baseUrl and can be change the baseUrl at runtime.

This library makes it easy to animate Floating Action Button to Bottom Sheet Dialog and vice versa.

Library to create a material search view similar to one used in apps developed by Google Inc.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes