text:
package com.androidsdk.snaphy.snaphyandroidsdk.repository;

import com.google.common.collect.ImmutableMap;
/*
Replacing with custom Snaphy callback methods
import com.strongloop.android.loopback.callbacks.ListCallback;
import com.strongloop.android.loopback.callbacks.ObjectCallback;
import com.strongloop.android.loopback.callbacks.VoidCallback;
*/
import com.androidsdk.snaphy.snaphyandroidsdk.callbacks.ObjectCallback;
import com.androidsdk.snaphy.snaphyandroidsdk.callbacks.DataListCallback;
import com.androidsdk.snaphy.snaphyandroidsdk.callbacks.VoidCallback;
import com.androidsdk.snaphy.snaphyandroidsdk.list.DataList;
import com.androidsdk.snaphy.snaphyandroidsdk.list.Util;

import com.strongloop.android.remoting.adapters.Adapter;
import com.strongloop.android.remoting.adapters.RestContract;
import com.strongloop.android.remoting.adapters.RestContractItem;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.lang.reflect.Method;
import android.util.Log;
import android.content.ContentValues;
import android.content.pm.PackageManager;
import android.content.Context;
import android.content.pm.ApplicationInfo;

//Replaced by Custom  Repo methods
// import com.strongloop.android.loopback.UserRepository;
import com.strongloop.android.loopback.AccessTokenRepository;
import com.strongloop.android.loopback.AccessToken;
import android.content.SharedPreferences;
import org.json.JSONException;
import android.content.Context;

import org.json.JSONArray;
import org.json.JSONObject;

//Import its models too.
import com.androidsdk.snaphy.snaphyandroidsdk.models.Customer;
import android.content.Context;
import com.androidsdk.snaphy.snaphyandroidsdk.db.CustomerDb;

//Now import model of related models..

            import com.androidsdk.snaphy.snaphyandroidsdk.models.Invoice;
            import com.androidsdk.snaphy.snaphyandroidsdk.repository.InvoiceRepository;

            import com.androidsdk.snaphy.snaphyandroidsdk.models.City;
            import com.androidsdk.snaphy.snaphyandroidsdk.repository.CityRepository;

            import com.androidsdk.snaphy.snaphyandroidsdk.models.Area;
            import com.androidsdk.snaphy.snaphyandroidsdk.repository.AreaRepository;

            import com.androidsdk.snaphy.snaphyandroidsdk.models.OrderSample;
            import com.androidsdk.snaphy.snaphyandroidsdk.repository.OrderSampleRepository;

            import com.androidsdk.snaphy.snaphyandroidsdk.models.PauseSubscription;
            import com.androidsdk.snaphy.snaphyandroidsdk.repository.PauseSubscriptionRepository;

            import com.androidsdk.snaphy.snaphyandroidsdk.models.ExtraDelivery;
            import com.androidsdk.snaphy.snaphyandroidsdk.repository.ExtraDeliveryRepository;

            import com.androidsdk.snaphy.snaphyandroidsdk.models.Subscription;
            import com.androidsdk.snaphy.snaphyandroidsdk.repository.SubscriptionRepository;

            import com.androidsdk.snaphy.snaphyandroidsdk.models.NotificationData;
            import com.androidsdk.snaphy.snaphyandroidsdk.repository.NotificationDataRepository;

public class CustomerRepository extends UserRepository<Customer> {

    private Context context;
    private String METADATA_DATABASE_NAME_KEY = "snaphy.database.name";
    private static String DATABASE_NAME;

    public CustomerRepository(){
        super("Customer", null, Customer.class);

    }

    public Context getContext(){
        return context;
    }

    		//Create public methods..
    		public Customer cachedCurrentUser;
            private Object currentUserId;
            private boolean isCurrentUserIdLoaded;

    		public Customer getCachedCurrentUser(){
    			return cachedCurrentUser;
    		}

    		public void setCachedCurrentUser(Customer user){
    			cachedCurrentUser = user;
    		}

    		/* public void setCurrentUserId(Object id){
    			super.setCurrentUserId(id);
    		} */

            public void findCurrentUser(final ObjectCallback<Customer> callback){
                //Call the onBefore method..
                callback.onBefore();

                if(getCurrentUserId() == null){
                    callback.onSuccess(null);
                    return;
                }

                HashMap<String, Object> hashMap = new HashMap<>();
                this.findById((String)getCurrentUserId(), hashMap, new ObjectCallback<Customer>() {
                    @Override
                    public void onSuccess(Customer user){
                        cachedCurrentUser = user;
                        callback.onSuccess(user);
                        //Call the finally method..
                        callback.onFinally();
                    }

                    @Override
                    public void onError(Throwable t){
                        callback.onError(t);
                        //Call the finally method..
                        callback.onFinally();
                    }
                });
            }

            public Object getCurrentUserId(){
                if(currentUserId != null){
                  return currentUserId;
                }
                else{
                  String json = getSharedPreferences().getString(PROPERTY_CURRENT_USER_ID, null);
                  if(json == null){
                      return null;
                  }

                  if(json.equals("[null]")){
                      return null;
                  }

                  try{
                      Object id = new JSONArray(json).get(0);
                      return id;
                  }catch(JSONException e){
                      String msg = "Cannot parse user id '" + json + "'";
                      Log.e("Snaphy", msg, e);
                  }
                }
                return null;
            }

            public void setCurrentUserId(Object currentUserId){
                this.currentUserId = currentUserId;
                cachedCurrentUser = null;
                saveCurrentUserId();
            }

            private void saveCurrentUserId(){
                final SharedPreferences.Editor editor = getSharedPreferences().edit();
                final String json = new JSONArray().put(getCurrentUserId()).toString();
                editor.putString(PROPERTY_CURRENT_USER_ID, json);
                editor.commit();
            }

            private SharedPreferences getSharedPreferences() {
                return getApplicationContext().getSharedPreferences(
                    SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
            }

    public CustomerDb getDb() {
      return customerDb;
    }

    public void setCustomerDb(CustomerDb customerDb) {
      this.customerDb = customerDb;
    }

    private CustomerDb customerDb;

    //Flag to check either to store data locally or not..
    private boolean STORE_LOCALLY = true;

    public boolean isSTORE_LOCALLY() {
      return STORE_LOCALLY;
    }

    public void  persistData(boolean persist){
      STORE_LOCALLY = persist;
    }

    public void reset__db(){
      if(isSTORE_LOCALLY()){
          getDb().reset__db();
      }
    }

    public void addStorage(Context context){
         try{
            ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
            DATABASE_NAME = (String) ai.metaData.get(METADATA_DATABASE_NAME_KEY);
         }
         catch (Exception e){
            Log.e("Snaphy", e.toString());
         }
         setCustomerDb(new CustomerDb(context, DATABASE_NAME, getRestAdapter()));
         //allow data storage locally..
         persistData(true);
         this.context = context;
    }

    public RestContract createContract() {
    RestContract contract = super.createContract();

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/accessTokens/:fk", "GET"), "Customer.prototype.__findById__accessTokens");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/accessTokens/:fk", "DELETE"), "Customer.prototype.__destroyById__accessTokens");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/accessTokens/:fk", "PUT"), "Customer.prototype.__updateById__accessTokens");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/invoices/:fk", "GET"), "Customer.prototype.__findById__invoices");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/invoices/:fk", "DELETE"), "Customer.prototype.__destroyById__invoices");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/invoices/:fk", "PUT"), "Customer.prototype.__updateById__invoices");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/subscriptions/:fk", "GET"), "Customer.prototype.__findById__subscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/subscriptions/:fk", "DELETE"), "Customer.prototype.__destroyById__subscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/subscriptions/:fk", "PUT"), "Customer.prototype.__updateById__subscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/pauseSubscriptions/:fk", "GET"), "Customer.prototype.__findById__pauseSubscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/pauseSubscriptions/:fk", "DELETE"), "Customer.prototype.__destroyById__pauseSubscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/pauseSubscriptions/:fk", "PUT"), "Customer.prototype.__updateById__pauseSubscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/extraDeliveries/:fk", "GET"), "Customer.prototype.__findById__extraDeliveries");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/extraDeliveries/:fk", "DELETE"), "Customer.prototype.__destroyById__extraDeliveries");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/extraDeliveries/:fk", "PUT"), "Customer.prototype.__updateById__extraDeliveries");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/city", "GET"), "Customer.prototype.__get__city");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/area", "GET"), "Customer.prototype.__get__area");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/orderSamples/:fk", "GET"), "Customer.prototype.__findById__orderSamples");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/orderSamples/:fk", "DELETE"), "Customer.prototype.__destroyById__orderSamples");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/orderSamples/:fk", "PUT"), "Customer.prototype.__updateById__orderSamples");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/notificationData/:fk", "GET"), "Customer.prototype.__findById__notificationData");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/notificationData/:fk", "DELETE"), "Customer.prototype.__destroyById__notificationData");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/notificationData/:fk", "PUT"), "Customer.prototype.__updateById__notificationData");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/accessTokens", "GET"), "Customer.prototype.__get__accessTokens");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/accessTokens", "POST"), "Customer.prototype.__create__accessTokens");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/accessTokens", "DELETE"), "Customer.prototype.__delete__accessTokens");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/accessTokens/count", "GET"), "Customer.prototype.__count__accessTokens");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/invoices", "GET"), "Customer.prototype.__get__invoices");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/invoices", "POST"), "Customer.prototype.__create__invoices");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/invoices", "DELETE"), "Customer.prototype.__delete__invoices");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/invoices/count", "GET"), "Customer.prototype.__count__invoices");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/subscriptions", "GET"), "Customer.prototype.__get__subscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/subscriptions", "POST"), "Customer.prototype.__create__subscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/subscriptions", "DELETE"), "Customer.prototype.__delete__subscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/subscriptions/count", "GET"), "Customer.prototype.__count__subscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/pauseSubscriptions", "GET"), "Customer.prototype.__get__pauseSubscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/pauseSubscriptions", "POST"), "Customer.prototype.__create__pauseSubscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/pauseSubscriptions", "DELETE"), "Customer.prototype.__delete__pauseSubscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/pauseSubscriptions/count", "GET"), "Customer.prototype.__count__pauseSubscriptions");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/extraDeliveries", "GET"), "Customer.prototype.__get__extraDeliveries");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/extraDeliveries", "POST"), "Customer.prototype.__create__extraDeliveries");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/extraDeliveries", "DELETE"), "Customer.prototype.__delete__extraDeliveries");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/extraDeliveries/count", "GET"), "Customer.prototype.__count__extraDeliveries");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/orderSamples", "GET"), "Customer.prototype.__get__orderSamples");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/orderSamples", "POST"), "Customer.prototype.__create__orderSamples");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/orderSamples", "DELETE"), "Customer.prototype.__delete__orderSamples");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/orderSamples/count", "GET"), "Customer.prototype.__count__orderSamples");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/notificationData", "GET"), "Customer.prototype.__get__notificationData");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/notificationData", "POST"), "Customer.prototype.__create__notificationData");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/notificationData", "DELETE"), "Customer.prototype.__delete__notificationData");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId/notificationData/count", "GET"), "Customer.prototype.__count__notificationData");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/", "POST"), "Customer.create");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/", "POST"), "Customer.create");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/", "PUT"), "Customer.upsert");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:id/exists", "GET"), "Customer.exists");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:id", "GET"), "Customer.findById");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/", "GET"), "Customer.find");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/findOne", "GET"), "Customer.findOne");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/update", "POST"), "Customer.updateAll");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:id", "DELETE"), "Customer.deleteById");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/count", "GET"), "Customer.count");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/:customerId", "PUT"), "Customer.prototype.updateAttributes");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/confirm", "GET"), "Customer.confirm");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/reset", "POST"), "Customer.resetPassword");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/getSchema", "POST"), "Customer.getSchema");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/getAbsoluteSchema", "POST"), "Customer.getAbsoluteSchema");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/getSubscribedCustomer", "POST"), "Customer.getSubscribedCustomer");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/countSubscribedCustomer", "POST"), "Customer.countSubscribedCustomer");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/getSummaryReports", "POST"), "Customer.getSummaryReports");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/generateInvoiceReports", "POST"), "Customer.generateInvoiceReports");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/findCustomer", "POST"), "Customer.findCustomer");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/countCustomer", "POST"), "Customer.countCustomer");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/findDeliveryBreakup", "POST"), "Customer.findDeliveryBreakup");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/getHomeAnalytics", "POST"), "Customer.getHomeAnalytics");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/subscribeOrderSample", "POST"), "Customer.subscribeOrderSample");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/customerSubscription", "POST"), "Customer.customerSubscription");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/mailReport", "POST"), "Customer.mailReport");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/downloadReport/:fileName", "GET"), "Customer.downloadReport");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/getMonthlyReport", "POST"), "Customer.getMonthlyReport");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/generateMonthlyReport", "POST"), "Customer.generateMonthlyReport");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/getDetailSchema", "POST"), "Customer.getDetailSchema");

    contract.addItem(new RestContractItem("/" + getNameForRestUrl() + "/getModelRelationSchema", "POST"), "Customer.getModelRelationSchema");

    return contract;
    }

//override getNameForRestUrlMethod
    public String  getNameForRestUrl() {

            //call super method instead..
            return super.getNameForRestUrl();

    }

            //Method findById__accessTokens definition
            public void findById__accessTokens(  String customerId,  String fk, final ObjectCallback<AccessToken> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__findById__accessTokens", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    AccessTokenRepository accessTokenRepo = getRestAdapter().createRepository(AccessTokenRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = accessTokenRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(accessTokenRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //accessTokenRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    AccessToken accessToken = accessTokenRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = accessToken.getClass().getMethod("save__db");
                                                    method.invoke(accessToken);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(accessToken);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findById__accessTokens definition ends here..

            //Method destroyById__accessTokens definition
            public void destroyById__accessTokens(  String customerId,  String fk, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__destroyById__accessTokens", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method destroyById__accessTokens definition ends here..

            //Method updateById__accessTokens definition
            public void updateById__accessTokens(  String customerId,  String fk,  Map<String,  ? extends Object> data, final ObjectCallback<AccessToken> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__updateById__accessTokens", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    AccessTokenRepository accessTokenRepo = getRestAdapter().createRepository(AccessTokenRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = accessTokenRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(accessTokenRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //accessTokenRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    AccessToken accessToken = accessTokenRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = accessToken.getClass().getMethod("save__db");
                                                    method.invoke(accessToken);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(accessToken);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateById__accessTokens definition ends here..

            //Method findById__invoices definition
            public void findById__invoices(  String customerId,  String fk, final ObjectCallback<Invoice> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__findById__invoices", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    InvoiceRepository invoiceRepo = getRestAdapter().createRepository(InvoiceRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = invoiceRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(invoiceRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //invoiceRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Invoice invoice = invoiceRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = invoice.getClass().getMethod("save__db");
                                                    method.invoke(invoice);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(invoice);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findById__invoices definition ends here..

            //Method destroyById__invoices definition
            public void destroyById__invoices(  String customerId,  String fk, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__destroyById__invoices", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method destroyById__invoices definition ends here..

            //Method updateById__invoices definition
            public void updateById__invoices(  String customerId,  String fk,  Map<String,  ? extends Object> data, final ObjectCallback<Invoice> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__updateById__invoices", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    InvoiceRepository invoiceRepo = getRestAdapter().createRepository(InvoiceRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = invoiceRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(invoiceRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //invoiceRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Invoice invoice = invoiceRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = invoice.getClass().getMethod("save__db");
                                                    method.invoke(invoice);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(invoice);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateById__invoices definition ends here..

            //Method findById__subscriptions definition
            public void findById__subscriptions(  String customerId,  String fk, final ObjectCallback<Subscription> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__findById__subscriptions", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    SubscriptionRepository subscriptionRepo = getRestAdapter().createRepository(SubscriptionRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = subscriptionRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(subscriptionRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //subscriptionRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Subscription subscription = subscriptionRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = subscription.getClass().getMethod("save__db");
                                                    method.invoke(subscription);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(subscription);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findById__subscriptions definition ends here..

            //Method destroyById__subscriptions definition
            public void destroyById__subscriptions(  String customerId,  String fk, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__destroyById__subscriptions", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method destroyById__subscriptions definition ends here..

            //Method updateById__subscriptions definition
            public void updateById__subscriptions(  String customerId,  String fk,  Map<String,  ? extends Object> data, final ObjectCallback<Subscription> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__updateById__subscriptions", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    SubscriptionRepository subscriptionRepo = getRestAdapter().createRepository(SubscriptionRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = subscriptionRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(subscriptionRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //subscriptionRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Subscription subscription = subscriptionRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = subscription.getClass().getMethod("save__db");
                                                    method.invoke(subscription);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(subscription);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateById__subscriptions definition ends here..

            //Method findById__pauseSubscriptions definition
            public void findById__pauseSubscriptions(  String customerId,  String fk, final ObjectCallback<PauseSubscription> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__findById__pauseSubscriptions", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    PauseSubscriptionRepository pauseSubscriptionRepo = getRestAdapter().createRepository(PauseSubscriptionRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = pauseSubscriptionRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(pauseSubscriptionRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //pauseSubscriptionRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    PauseSubscription pauseSubscription = pauseSubscriptionRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = pauseSubscription.getClass().getMethod("save__db");
                                                    method.invoke(pauseSubscription);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(pauseSubscription);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findById__pauseSubscriptions definition ends here..

            //Method destroyById__pauseSubscriptions definition
            public void destroyById__pauseSubscriptions(  String customerId,  String fk, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__destroyById__pauseSubscriptions", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method destroyById__pauseSubscriptions definition ends here..

            //Method updateById__pauseSubscriptions definition
            public void updateById__pauseSubscriptions(  String customerId,  String fk,  Map<String,  ? extends Object> data, final ObjectCallback<PauseSubscription> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__updateById__pauseSubscriptions", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    PauseSubscriptionRepository pauseSubscriptionRepo = getRestAdapter().createRepository(PauseSubscriptionRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = pauseSubscriptionRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(pauseSubscriptionRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //pauseSubscriptionRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    PauseSubscription pauseSubscription = pauseSubscriptionRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = pauseSubscription.getClass().getMethod("save__db");
                                                    method.invoke(pauseSubscription);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(pauseSubscription);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateById__pauseSubscriptions definition ends here..

            //Method findById__extraDeliveries definition
            public void findById__extraDeliveries(  String customerId,  String fk, final ObjectCallback<ExtraDelivery> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__findById__extraDeliveries", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    ExtraDeliveryRepository extraDeliveryRepo = getRestAdapter().createRepository(ExtraDeliveryRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = extraDeliveryRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(extraDeliveryRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //extraDeliveryRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    ExtraDelivery extraDelivery = extraDeliveryRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = extraDelivery.getClass().getMethod("save__db");
                                                    method.invoke(extraDelivery);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(extraDelivery);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findById__extraDeliveries definition ends here..

            //Method destroyById__extraDeliveries definition
            public void destroyById__extraDeliveries(  String customerId,  String fk, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__destroyById__extraDeliveries", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method destroyById__extraDeliveries definition ends here..

            //Method updateById__extraDeliveries definition
            public void updateById__extraDeliveries(  String customerId,  String fk,  Map<String,  ? extends Object> data, final ObjectCallback<ExtraDelivery> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__updateById__extraDeliveries", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    ExtraDeliveryRepository extraDeliveryRepo = getRestAdapter().createRepository(ExtraDeliveryRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = extraDeliveryRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(extraDeliveryRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //extraDeliveryRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    ExtraDelivery extraDelivery = extraDeliveryRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = extraDelivery.getClass().getMethod("save__db");
                                                    method.invoke(extraDelivery);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(extraDelivery);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateById__extraDeliveries definition ends here..

            //Method get__city definition
            public void get__city(  String customerId,  Boolean refresh, final ObjectCallback<City> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("refresh", refresh);

                    invokeStaticMethod("prototype.__get__city", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    CityRepository cityRepo = getRestAdapter().createRepository(CityRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = cityRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(cityRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //cityRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    City city = cityRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = city.getClass().getMethod("save__db");
                                                    method.invoke(city);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(city);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method get__city definition ends here..

            //Method get__area definition
            public void get__area(  String customerId,  Boolean refresh, final ObjectCallback<Area> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("refresh", refresh);

                    invokeStaticMethod("prototype.__get__area", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    AreaRepository areaRepo = getRestAdapter().createRepository(AreaRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = areaRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(areaRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //areaRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Area area = areaRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = area.getClass().getMethod("save__db");
                                                    method.invoke(area);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(area);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method get__area definition ends here..

            //Method findById__orderSamples definition
            public void findById__orderSamples(  String customerId,  String fk, final ObjectCallback<OrderSample> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__findById__orderSamples", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    OrderSampleRepository orderSampleRepo = getRestAdapter().createRepository(OrderSampleRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = orderSampleRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(orderSampleRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //orderSampleRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    OrderSample orderSample = orderSampleRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = orderSample.getClass().getMethod("save__db");
                                                    method.invoke(orderSample);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(orderSample);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findById__orderSamples definition ends here..

            //Method destroyById__orderSamples definition
            public void destroyById__orderSamples(  String customerId,  String fk, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__destroyById__orderSamples", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method destroyById__orderSamples definition ends here..

            //Method updateById__orderSamples definition
            public void updateById__orderSamples(  String customerId,  String fk,  Map<String,  ? extends Object> data, final ObjectCallback<OrderSample> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__updateById__orderSamples", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    OrderSampleRepository orderSampleRepo = getRestAdapter().createRepository(OrderSampleRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = orderSampleRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(orderSampleRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //orderSampleRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    OrderSample orderSample = orderSampleRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = orderSample.getClass().getMethod("save__db");
                                                    method.invoke(orderSample);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(orderSample);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateById__orderSamples definition ends here..

            //Method findById__notificationData definition
            public void findById__notificationData(  String customerId,  String fk, final ObjectCallback<NotificationData> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__findById__notificationData", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    NotificationDataRepository notificationDataRepo = getRestAdapter().createRepository(NotificationDataRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = notificationDataRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(notificationDataRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //notificationDataRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    NotificationData notificationData = notificationDataRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = notificationData.getClass().getMethod("save__db");
                                                    method.invoke(notificationData);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(notificationData);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findById__notificationData definition ends here..

            //Method destroyById__notificationData definition
            public void destroyById__notificationData(  String customerId,  String fk, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                    invokeStaticMethod("prototype.__destroyById__notificationData", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method destroyById__notificationData definition ends here..

            //Method updateById__notificationData definition
            public void updateById__notificationData(  String customerId,  String fk,  Map<String,  ? extends Object> data, final ObjectCallback<NotificationData> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("fk", fk);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__updateById__notificationData", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    NotificationDataRepository notificationDataRepo = getRestAdapter().createRepository(NotificationDataRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = notificationDataRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(notificationDataRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //notificationDataRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    NotificationData notificationData = notificationDataRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = notificationData.getClass().getMethod("save__db");
                                                    method.invoke(notificationData);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(notificationData);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateById__notificationData definition ends here..

            //Method get__accessTokens definition
            public void get__accessTokens(  String customerId,  Map<String,  ? extends Object> filter, final DataListCallback<AccessToken> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("prototype.__get__accessTokens", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<AccessToken> accessTokenList = new DataList<AccessToken>();
                                    AccessTokenRepository accessTokenRepo = getRestAdapter().createRepository(AccessTokenRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = accessTokenRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(accessTokenRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        AccessToken accessToken = accessTokenRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = accessToken.getClass().getMethod("save__db");
                                                      method.invoke(accessToken);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        accessTokenList.add(accessToken);
                                    }
                                    callback.onSuccess(accessTokenList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method get__accessTokens definition ends here..

            //Method create__accessTokens definition
            public void create__accessTokens(  String customerId,  Map<String,  ? extends Object> data, final ObjectCallback<AccessToken> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__create__accessTokens", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    AccessTokenRepository accessTokenRepo = getRestAdapter().createRepository(AccessTokenRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = accessTokenRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(accessTokenRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //accessTokenRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    AccessToken accessToken = accessTokenRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = accessToken.getClass().getMethod("save__db");
                                                    method.invoke(accessToken);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(accessToken);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method create__accessTokens definition ends here..

            //Method delete__accessTokens definition
            public void delete__accessTokens(  String customerId, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                    invokeStaticMethod("prototype.__delete__accessTokens", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method delete__accessTokens definition ends here..

            //Method count__accessTokens definition
            public void count__accessTokens(  String customerId,  Map<String,  ? extends Object> where, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("where", where);

                    invokeStaticMethod("prototype.__count__accessTokens", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method count__accessTokens definition ends here..

            //Method get__invoices definition
            public void get__invoices(  String customerId,  Map<String,  ? extends Object> filter, final DataListCallback<Invoice> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("prototype.__get__invoices", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<Invoice> invoiceList = new DataList<Invoice>();
                                    InvoiceRepository invoiceRepo = getRestAdapter().createRepository(InvoiceRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = invoiceRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(invoiceRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        Invoice invoice = invoiceRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = invoice.getClass().getMethod("save__db");
                                                      method.invoke(invoice);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        invoiceList.add(invoice);
                                    }
                                    callback.onSuccess(invoiceList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method get__invoices definition ends here..

            //Method create__invoices definition
            public void create__invoices(  String customerId,  Map<String,  ? extends Object> data, final ObjectCallback<Invoice> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__create__invoices", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    InvoiceRepository invoiceRepo = getRestAdapter().createRepository(InvoiceRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = invoiceRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(invoiceRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //invoiceRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Invoice invoice = invoiceRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = invoice.getClass().getMethod("save__db");
                                                    method.invoke(invoice);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(invoice);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method create__invoices definition ends here..

            //Method delete__invoices definition
            public void delete__invoices(  String customerId, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                    invokeStaticMethod("prototype.__delete__invoices", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method delete__invoices definition ends here..

            //Method count__invoices definition
            public void count__invoices(  String customerId,  Map<String,  ? extends Object> where, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("where", where);

                    invokeStaticMethod("prototype.__count__invoices", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method count__invoices definition ends here..

            //Method get__subscriptions definition
            public void get__subscriptions(  String customerId,  Map<String,  ? extends Object> filter, final DataListCallback<Subscription> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("prototype.__get__subscriptions", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<Subscription> subscriptionList = new DataList<Subscription>();
                                    SubscriptionRepository subscriptionRepo = getRestAdapter().createRepository(SubscriptionRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = subscriptionRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(subscriptionRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        Subscription subscription = subscriptionRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = subscription.getClass().getMethod("save__db");
                                                      method.invoke(subscription);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        subscriptionList.add(subscription);
                                    }
                                    callback.onSuccess(subscriptionList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method get__subscriptions definition ends here..

            //Method create__subscriptions definition
            public void create__subscriptions(  String customerId,  Map<String,  ? extends Object> data, final ObjectCallback<Subscription> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__create__subscriptions", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    SubscriptionRepository subscriptionRepo = getRestAdapter().createRepository(SubscriptionRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = subscriptionRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(subscriptionRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //subscriptionRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Subscription subscription = subscriptionRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = subscription.getClass().getMethod("save__db");
                                                    method.invoke(subscription);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(subscription);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method create__subscriptions definition ends here..

            //Method delete__subscriptions definition
            public void delete__subscriptions(  String customerId, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                    invokeStaticMethod("prototype.__delete__subscriptions", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method delete__subscriptions definition ends here..

            //Method count__subscriptions definition
            public void count__subscriptions(  String customerId,  Map<String,  ? extends Object> where, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("where", where);

                    invokeStaticMethod("prototype.__count__subscriptions", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method count__subscriptions definition ends here..

            //Method get__pauseSubscriptions definition
            public void get__pauseSubscriptions(  String customerId,  Map<String,  ? extends Object> filter, final DataListCallback<PauseSubscription> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("prototype.__get__pauseSubscriptions", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<PauseSubscription> pauseSubscriptionList = new DataList<PauseSubscription>();
                                    PauseSubscriptionRepository pauseSubscriptionRepo = getRestAdapter().createRepository(PauseSubscriptionRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = pauseSubscriptionRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(pauseSubscriptionRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        PauseSubscription pauseSubscription = pauseSubscriptionRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = pauseSubscription.getClass().getMethod("save__db");
                                                      method.invoke(pauseSubscription);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        pauseSubscriptionList.add(pauseSubscription);
                                    }
                                    callback.onSuccess(pauseSubscriptionList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method get__pauseSubscriptions definition ends here..

            //Method create__pauseSubscriptions definition
            public void create__pauseSubscriptions(  String customerId,  Map<String,  ? extends Object> data, final ObjectCallback<PauseSubscription> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__create__pauseSubscriptions", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    PauseSubscriptionRepository pauseSubscriptionRepo = getRestAdapter().createRepository(PauseSubscriptionRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = pauseSubscriptionRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(pauseSubscriptionRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //pauseSubscriptionRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    PauseSubscription pauseSubscription = pauseSubscriptionRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = pauseSubscription.getClass().getMethod("save__db");
                                                    method.invoke(pauseSubscription);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(pauseSubscription);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method create__pauseSubscriptions definition ends here..

            //Method delete__pauseSubscriptions definition
            public void delete__pauseSubscriptions(  String customerId, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                    invokeStaticMethod("prototype.__delete__pauseSubscriptions", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method delete__pauseSubscriptions definition ends here..

            //Method count__pauseSubscriptions definition
            public void count__pauseSubscriptions(  String customerId,  Map<String,  ? extends Object> where, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("where", where);

                    invokeStaticMethod("prototype.__count__pauseSubscriptions", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method count__pauseSubscriptions definition ends here..

            //Method get__extraDeliveries definition
            public void get__extraDeliveries(  String customerId,  Map<String,  ? extends Object> filter, final DataListCallback<ExtraDelivery> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("prototype.__get__extraDeliveries", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<ExtraDelivery> extraDeliveryList = new DataList<ExtraDelivery>();
                                    ExtraDeliveryRepository extraDeliveryRepo = getRestAdapter().createRepository(ExtraDeliveryRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = extraDeliveryRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(extraDeliveryRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        ExtraDelivery extraDelivery = extraDeliveryRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = extraDelivery.getClass().getMethod("save__db");
                                                      method.invoke(extraDelivery);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        extraDeliveryList.add(extraDelivery);
                                    }
                                    callback.onSuccess(extraDeliveryList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method get__extraDeliveries definition ends here..

            //Method create__extraDeliveries definition
            public void create__extraDeliveries(  String customerId,  Map<String,  ? extends Object> data, final ObjectCallback<ExtraDelivery> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__create__extraDeliveries", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    ExtraDeliveryRepository extraDeliveryRepo = getRestAdapter().createRepository(ExtraDeliveryRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = extraDeliveryRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(extraDeliveryRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //extraDeliveryRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    ExtraDelivery extraDelivery = extraDeliveryRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = extraDelivery.getClass().getMethod("save__db");
                                                    method.invoke(extraDelivery);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(extraDelivery);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method create__extraDeliveries definition ends here..

            //Method delete__extraDeliveries definition
            public void delete__extraDeliveries(  String customerId, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                    invokeStaticMethod("prototype.__delete__extraDeliveries", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method delete__extraDeliveries definition ends here..

            //Method count__extraDeliveries definition
            public void count__extraDeliveries(  String customerId,  Map<String,  ? extends Object> where, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("where", where);

                    invokeStaticMethod("prototype.__count__extraDeliveries", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method count__extraDeliveries definition ends here..

            //Method get__orderSamples definition
            public void get__orderSamples(  String customerId,  Map<String,  ? extends Object> filter, final DataListCallback<OrderSample> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("prototype.__get__orderSamples", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<OrderSample> orderSampleList = new DataList<OrderSample>();
                                    OrderSampleRepository orderSampleRepo = getRestAdapter().createRepository(OrderSampleRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = orderSampleRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(orderSampleRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        OrderSample orderSample = orderSampleRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = orderSample.getClass().getMethod("save__db");
                                                      method.invoke(orderSample);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        orderSampleList.add(orderSample);
                                    }
                                    callback.onSuccess(orderSampleList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method get__orderSamples definition ends here..

            //Method create__orderSamples definition
            public void create__orderSamples(  String customerId,  Map<String,  ? extends Object> data, final ObjectCallback<OrderSample> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__create__orderSamples", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    OrderSampleRepository orderSampleRepo = getRestAdapter().createRepository(OrderSampleRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = orderSampleRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(orderSampleRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //orderSampleRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    OrderSample orderSample = orderSampleRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = orderSample.getClass().getMethod("save__db");
                                                    method.invoke(orderSample);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(orderSample);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method create__orderSamples definition ends here..

            //Method delete__orderSamples definition
            public void delete__orderSamples(  String customerId, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                    invokeStaticMethod("prototype.__delete__orderSamples", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method delete__orderSamples definition ends here..

            //Method count__orderSamples definition
            public void count__orderSamples(  String customerId,  Map<String,  ? extends Object> where, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("where", where);

                    invokeStaticMethod("prototype.__count__orderSamples", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method count__orderSamples definition ends here..

            //Method get__notificationData definition
            public void get__notificationData(  String customerId,  Map<String,  ? extends Object> filter, final DataListCallback<NotificationData> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("prototype.__get__notificationData", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<NotificationData> notificationDataList = new DataList<NotificationData>();
                                    NotificationDataRepository notificationDataRepo = getRestAdapter().createRepository(NotificationDataRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = notificationDataRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(notificationDataRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        NotificationData notificationData = notificationDataRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = notificationData.getClass().getMethod("save__db");
                                                      method.invoke(notificationData);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        notificationDataList.add(notificationData);
                                    }
                                    callback.onSuccess(notificationDataList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method get__notificationData definition ends here..

            //Method create__notificationData definition
            public void create__notificationData(  String customerId,  Map<String,  ? extends Object> data, final ObjectCallback<NotificationData> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.__create__notificationData", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    NotificationDataRepository notificationDataRepo = getRestAdapter().createRepository(NotificationDataRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = notificationDataRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(notificationDataRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //notificationDataRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    NotificationData notificationData = notificationDataRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = notificationData.getClass().getMethod("save__db");
                                                    method.invoke(notificationData);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(notificationData);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method create__notificationData definition ends here..

            //Method delete__notificationData definition
            public void delete__notificationData(  String customerId, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                    invokeStaticMethod("prototype.__delete__notificationData", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method delete__notificationData definition ends here..

            //Method count__notificationData definition
            public void count__notificationData(  String customerId,  Map<String,  ? extends Object> where, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("where", where);

                    invokeStaticMethod("prototype.__count__notificationData", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method count__notificationData definition ends here..

            //Method create definition
            public void create(  Map<String,  ? extends Object> data, final ObjectCallback<Customer> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.putAll(data);

                    invokeStaticMethod("create", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    CustomerRepository customerRepo = getRestAdapter().createRepository(CustomerRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = customerRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(customerRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //customerRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Customer customer = customerRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = customer.getClass().getMethod("save__db");
                                                    method.invoke(customer);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(customer);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method create definition ends here..

            //Method upsert definition
            public void upsert(  Map<String,  ? extends Object> data, final ObjectCallback<Customer> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.putAll(data);

                    invokeStaticMethod("upsert", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    CustomerRepository customerRepo = getRestAdapter().createRepository(CustomerRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = customerRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(customerRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //customerRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Customer customer = customerRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = customer.getClass().getMethod("save__db");
                                                    method.invoke(customer);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(customer);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method upsert definition ends here..

            //Method exists definition
            public void exists(  String id, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("id", id);

                    invokeStaticMethod("exists", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method exists definition ends here..

            //Method findById definition
            public void findById(  String id,  Map<String,  ? extends Object> filter, final ObjectCallback<Customer> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("id", id);

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("findById", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    CustomerRepository customerRepo = getRestAdapter().createRepository(CustomerRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = customerRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(customerRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //customerRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Customer customer = customerRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = customer.getClass().getMethod("save__db");
                                                    method.invoke(customer);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(customer);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findById definition ends here..

            //Method find definition
            public void find(  Map<String,  ? extends Object> filter, final DataListCallback<Customer> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("find", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<Customer> customerList = new DataList<Customer>();
                                    CustomerRepository customerRepo = getRestAdapter().createRepository(CustomerRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = customerRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(customerRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        Customer customer = customerRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = customer.getClass().getMethod("save__db");
                                                      method.invoke(customer);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        customerList.add(customer);
                                    }
                                    callback.onSuccess(customerList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method find definition ends here..

            //Method findOne definition
            public void findOne(  Map<String,  ? extends Object> filter, final ObjectCallback<Customer> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("filter", filter);

                    invokeStaticMethod("findOne", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    CustomerRepository customerRepo = getRestAdapter().createRepository(CustomerRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = customerRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(customerRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //customerRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Customer customer = customerRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = customer.getClass().getMethod("save__db");
                                                    method.invoke(customer);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(customer);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findOne definition ends here..

            //Method updateAll definition
            public void updateAll(  Map<String,  ? extends Object> where,  Map<String,  ? extends Object> data, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("where", where);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("updateAll", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateAll definition ends here..

            //Method deleteById definition
            public void deleteById(  String id, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("id", id);

                    invokeStaticMethod("deleteById", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method deleteById definition ends here..

            //Method count definition
            public void count(  Map<String,  ? extends Object> where, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("where", where);

                    invokeStaticMethod("count", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method count definition ends here..

            //Method updateAttributes definition
            public void updateAttributes(  String customerId,  Map<String,  ? extends Object> data, final ObjectCallback<Customer> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.putAll(data);

                    invokeStaticMethod("prototype.updateAttributes", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                if(response != null){
                                    CustomerRepository customerRepo = getRestAdapter().createRepository(CustomerRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = customerRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(customerRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }

                                        //customerRepo.addStorage(context);
                                    }
                                    Map<String, Object> result = Util.fromJson(response);
                                    Customer customer = customerRepo.createObject(result);

                                      //Add to database if persistent storage required..
                                      if(isSTORE_LOCALLY()){
                                          //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                          try {
                                                    Method method = customer.getClass().getMethod("save__db");
                                                    method.invoke(customer);

                                          } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                          }

                                      }

                                    callback.onSuccess(customer);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method updateAttributes definition ends here..

            //Method confirm definition
            public void confirm(  String uid,  String token,  String redirect, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("uid", uid);

                        hashMapObject.put("token", token);

                        hashMapObject.put("redirect", redirect);

                    invokeStaticMethod("confirm", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method confirm definition ends here..

            //Method resetPassword definition
            public void resetPassword(  Map<String,  ? extends Object> options, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("options", options);

                    invokeStaticMethod("resetPassword", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method resetPassword definition ends here..

            //Method getSchema definition
            public void getSchema( final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                    invokeStaticMethod("getSchema", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method getSchema definition ends here..

            //Method getAbsoluteSchema definition
            public void getAbsoluteSchema( final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                    invokeStaticMethod("getAbsoluteSchema", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method getAbsoluteSchema definition ends here..

            //Method getSubscribedCustomer definition
            public void getSubscribedCustomer(  Map<String,  ? extends Object> options, final DataListCallback<Customer> callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("options", options);

                    invokeStaticMethod("getSubscribedCustomer", hashMapObject, new Adapter.JsonArrayCallback() {
                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONArray response) {
                          try{

                                if(response != null){
                                    //Now converting jsonObject to list
                                    DataList<Map<String, Object>> result = (DataList) Util.fromJson(response);
                                    DataList<Customer> customerList = new DataList<Customer>();
                                    CustomerRepository customerRepo = getRestAdapter().createRepository(CustomerRepository.class);
                                    if(context != null){
                                        try {
                                            Method method = customerRepo.getClass().getMethod("addStorage", Context.class);
                                            method.invoke(customerRepo, context);

                                        } catch (Exception e) {
                                            Log.e("Database Error", e.toString());
                                        }
                                    }
                                    for (Map<String, Object> obj : result) {

                                        Customer customer = customerRepo.createObject(obj);

                                        //Add to database if persistent storage required..
                                        if(isSTORE_LOCALLY()){
                                            //http://stackoverflow.com/questions/160970/how-do-i-invoke-a-java-method-when-given-the-method-name-as-a-string
                                            try {
                                                      Method method = customer.getClass().getMethod("save__db");
                                                      method.invoke(customer);

                                            } catch (Exception e) {
                                                Log.e("Database Error", e.toString());
                                            }
                                        }

                                        customerList.add(customer);
                                    }
                                    callback.onSuccess(customerList);
                                }else{
                                    callback.onSuccess(null);
                                }

                          }catch(Exception e){
                            Log.e("Snaphy",e.toString());
                          }
                          //Call the finally method..
                          callback.onFinally();
                        }
                    });

            }//Method getSubscribedCustomer definition ends here..

            //Method countSubscribedCustomer definition
            public void countSubscribedCustomer(  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("options", options);

                    invokeStaticMethod("countSubscribedCustomer", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method countSubscribedCustomer definition ends here..

            //Method getSummaryReports definition
            public void getSummaryReports(  String customerId,  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("options", options);

                    invokeStaticMethod("getSummaryReports", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method getSummaryReports definition ends here..

            //Method generateInvoiceReports definition
            public void generateInvoiceReports(  String customerId,  double month, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("month", month);

                    invokeStaticMethod("generateInvoiceReports", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method generateInvoiceReports definition ends here..

            //Method findCustomer definition
            public void findCustomer(  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("options", options);

                    invokeStaticMethod("findCustomer", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findCustomer definition ends here..

            //Method countCustomer definition
            public void countCustomer(  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("options", options);

                    invokeStaticMethod("countCustomer", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method countCustomer definition ends here..

            //Method findDeliveryBreakup definition
            public void findDeliveryBreakup(  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("options", options);

                    invokeStaticMethod("findDeliveryBreakup", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method findDeliveryBreakup definition ends here..

            //Method getHomeAnalytics definition
            public void getHomeAnalytics(  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("options", options);

                    invokeStaticMethod("getHomeAnalytics", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method getHomeAnalytics definition ends here..

            //Method subscribeOrderSample definition
            public void subscribeOrderSample(  Map<String,  ? extends Object> req,  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("req", req);

                        hashMapObject.put("options", options);

                    invokeStaticMethod("subscribeOrderSample", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method subscribeOrderSample definition ends here..

            //Method customerSubscription definition
            public void customerSubscription(  Map<String,  ? extends Object> req, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("req", req);

                    invokeStaticMethod("customerSubscription", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method customerSubscription definition ends here..

            //Method mailReport definition
            public void mailReport(  String customerId,  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("customerId", customerId);

                        hashMapObject.put("options", options);

                    invokeStaticMethod("mailReport", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method mailReport definition ends here..

            //Method downloadReport definition
            public void downloadReport(  String fileName,  Map<String,  ? extends Object> res, final VoidCallback callback){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("fileName", fileName);

                        hashMapObject.put("res", res);

                    invokeStaticMethod("downloadReport", hashMapObject, new Adapter.Callback() {
                        @Override
                        public void onError(Throwable t) {
                                callback.onError(t);
                                //Call the finally method..
                                callback.onFinally();
                        }

                        @Override
                        public void onSuccess(String response) {
                            callback.onSuccess();
                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method downloadReport definition ends here..

            //Method getMonthlyReport definition
            public void getMonthlyReport(  Map<String,  ? extends Object> options, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("options", options);

                    invokeStaticMethod("getMonthlyReport", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method getMonthlyReport definition ends here..

            //Method generateMonthlyReport definition
            public void generateMonthlyReport(  String date,  String cityId,  String areaId, final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                        hashMapObject.put("date", date);

                        hashMapObject.put("cityId", cityId);

                        hashMapObject.put("areaId", areaId);

                    invokeStaticMethod("generateMonthlyReport", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method generateMonthlyReport definition ends here..

            //Method getDetailSchema definition
            public void getDetailSchema( final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                    invokeStaticMethod("getDetailSchema", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method getDetailSchema definition ends here..

            //Method getModelRelationSchema definition
            public void getModelRelationSchema( final ObjectCallback<JSONObject>  callback ){

                /**
                Call the onBefore event
                */
                callback.onBefore();

                //Definging hashMap for data conversion
                Map<String, Object> hashMapObject = new HashMap<>();
                //Now add the arguments...

                    invokeStaticMethod("getModelRelationSchema", hashMapObject, new Adapter.JsonObjectCallback() {

                        @Override
                        public void onError(Throwable t) {
                            callback.onError(t);
                            //Call the finally method..
                            callback.onFinally();
                        }

                        @Override
                        public void onSuccess(JSONObject response) {
                          try{

                                callback.onSuccess(response);

                          }catch(Exception e){
                            Log.e("Snaphy", e.toString());
                          }

                            //Call the finally method..
                            callback.onFinally();
                        }
                    });

            }//Method getModelRelationSchema definition ends here..

}