RBORMCenter Class Reference

Inherits from NSObject
Declared in RBORMCenter.h

Overview

Centrally manages SQLite databases and ORM objects.

  • Manages multiple SQLite databases.
  • Creates tables.
  • Manages RBORMObjects, and provides CRUD support.
  • Runs SQL queries directly.

+ shared

The shared singleton RBORMCenter.

+ (nullable RBORMCenter *)shared

Discussion

The shared singleton RBORMCenter.

Declared In

RBORMCenter.h

– registerNotificationReceiver:

Registers an object to receive notifications whenever an interaction occurs with a managed RBORMObject or RBSQLiteConnection objects.

- (BOOL)registerNotificationReceiver:(nonnull id<RBORMObserver>)receiver

Parameters

receiver

The object that should receive notification events.

Return Value

Returns YES if registration was succesful.

Discussion

Registers an object to receive notifications whenever an interaction occurs with a managed RBORMObject or RBSQLiteConnection objects.

Declared In

RBORMCenter.h

– deregisterNotificationReceiver:

Detaches an existing object from receiving event notifications.

- (void)deregisterNotificationReceiver:(nonnull id<RBORMObserver>)receiver

Parameters

receiver

The object that should no longer receive notifications.

Discussion

Detaches an existing object from receiving event notifications.

Declared In

RBORMCenter.h

– attachDatabaseConnection:withIdentifier:

Attaches a RBSQLiteConnection connection for management by the RBORMCenter.

- (BOOL)attachDatabaseConnection:(nonnull RBSQLiteConnection *)databaseConnection withIdentifier:(nonnull NSString *)identifier

Parameters

databaseConnection

The database connection to manage.

identifier

An identifier which will be used to reference this specific database connection.

Return Value

Returns YES if the RBSQLiteConnection was successfully attached.

Discussion

Attaches a RBSQLiteConnection connection for management by the RBORMCenter.

Declared In

RBORMCenter.h

– detachDatabaseConnectionWithIdentifier:

Detaches an existing RBSQLiteConnection database connection.

- (nullable RBSQLiteConnection *)detachDatabaseConnectionWithIdentifier:(nonnull NSString *)identifier

Parameters

identifier

The database identifier reference for the database connection to detach.

Return Value

Returns the detached RBSQLiteConnection connection or nil.

Discussion

Detaches an existing RBSQLiteConnection database connection.

Declared In

RBORMCenter.h

– databaseConnectionForIdentifier:

Returns the RBSQLiteConnection database connection that corresponds to the specified identifier.

- (nullable RBSQLiteConnection *)databaseConnectionForIdentifier:(nonnull NSString *)identifier

Parameters

identifier

The database identifier.

Return Value

Returns the RBSQLiteConnection database connection or nil.

Discussion

Returns the RBSQLiteConnection database connection that corresponds to the specified identifier.

Declared In

RBORMCenter.h

– executeQuery:bindings:databaseIdentifier:

Executes a SQL query directly on a database and returns a RBSQLiteResult.

- (nullable RBSQLiteResult *)executeQuery:(nonnull NSString *)queryString bindings:(nullable NSArray *)bindings databaseIdentifier:(nonnull NSString *)identifier

Parameters

queryString

The formatted SQL query string, may contain ‘?’ bindings.

bindings

An array of items the provide the values that should correspond to the ‘?’ bindings specified in the query string.

identifier

The database identifier indicating which underlying database connection to query.

Return Value

Returns a RBSQLiteResult.

Discussion

Executes a SQL query directly on a database and returns a RBSQLiteResult.

Declared In

RBORMCenter.h