Skip to content
Siminov Framework edited this page Jan 16, 2016 · 7 revisions

Get Primary Keys

Android API: Get Primary Keys

    public final Iterator<String> getPrimaryKeys() throws DatabaseException;
  • Android Sample: Get Primary Keys
    Iterator<String> primaryKeys = null;
    try {
        primaryKeys = new Book().getPrimeryKeys();
    } catch(DatabaseException de) {
		//Log it.
    }

iOS API: Get Primary Keys

    - (NSArray *)getPrimaryKeys;
  • iOS Sample: Get Primary Keys
    NSArray *primaryKeys = nil;
    @try {
        primaryKeys = [[[Book alloc] init] getPrimeryKeys];
    } @catch(SICDatabaseException *databaseException) {
		//Log it.
    }

Windows API: Get Primary Keys

    public IEnumerator<String> GetPrimaryKeys();
  • Windows Sample: Get Primary Keys
    IEnumerator<String> primaryKeys = null;
    try 
    {
        primaryKeys = new Book().GetPrimeryKeys();
    } 
    catch(DatabaseException de) 
    {
		//Log it.
    }

JavaScript API: Get Primary Keys

    - this.getPrimaryKeys = function();
    - this.getPrimaryKeysAsync = function(callback, transaction);
  • JavaScript Sample: Get Primary Keys
            /** Get Primary Keys Sample **/

    var primaryKeys = null;
    try {
        primaryKeys = new Book().getPrimeryKeys();
    } catch(DatabaseException de) {
		//Log it.
    }
            /** Get Primary Keys Async Sample **/

    var callback = new Callback();
    callback.onSuccess = function(primaryKeys) {

    }

    new Book().getPrimaryKeysAsync(callback);
            /** Get Primary Keys Async Transaction Sample **/

    var callback = new Callback();
    callback.onExecute = function(transaction) {

        var primaryKeysCallback = new Callback();
        primaryKeysCallback.onSuccess = function() {

        }

        new Book().getPrimaryKeysAsync(primaryKeysCallback, transaction);
    }

    callback.onSuccess = function() {

    }

    var databaseDescriptor = new Lession().getDatabaseDescriptor();
    Database.beginTransactionAsync(databaseDescriptor, callback);