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

Get Foreign Keys

Android API: Get Foreign Keys

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

iOS API: Get Foreign Keys

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

Windows API: Get Foreign Keys

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

JavaScript API: Get Foreign Keys

    - this.getForeignKeys = function();
    - this.getForeignKeysAsync = function(callback, transaction);
  • JavaScript Sample: Get Foreign Keys
            /** Get Foreign Keys Sample **/

    var foreignKeys = null;
    try {
        foreignKeys = new Book().getForeignKeys();
    } catch(DatabaseException de) {
		//Log it.
    }
            /** Get Foreign Keys Async Sample **/

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

    }

    new Book().getForeignKeysAsync(callback);
            /** Get Foreign Keys Async Transaction Sample **/

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

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

        }

        new Book().getForeignKeysAsync(foreignKeysCallback, transaction);
    }

    callback.onSuccess = function() {

    }

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