function (connection, collections, cb) {
            if (LOG_DEBUG) {
                console.log("BEGIN registerConnection");
            }
            //BEGIN METODO POR DEFECTO
            if (!connection.identity)
                return cb(new Error('Connection is missing an identity.'));
            if (connections[connection.identity])
                return cb(new Error('Connection is already registered.'));
            //END MÉTODO POR DEFECTO

            var self = this;

            // Store any connection overrides
            connectionOverrides[connection.identity] = {};

            // Look for the WL Next key
            if (hop(connection, 'wlNext')) {
                connectionOverrides[connection.identity].wlNext = _.cloneDeep(connection.wlNext);
            }

            // Build up a schema for this connection that can be used throughout the adapter
            var schema = {};

            _.each(_.keys(collections), function (coll) {
                var collection = collections[coll];
                if (!collection)
                    return;

                var _schema = collection.waterline && collection.waterline.schema && collection.waterline.schema[collection.identity];
                if (!_schema)
                    return;

                // Set defaults to ensure values are set
                if (!_schema.attributes)
                    _schema.attributes = {};
                if (!_schema.tableName)
                    _schema.tableName = coll;

                // If the connection names are't the same we don't need it in the schema
                if (!_.includes(collections[coll].connection, connection.identity)) {
                    return;
                }

                // If the tableName is different from the identity, store the tableName in the schema
                var schemaKey = coll;
                if (_schema.tableName != coll) {
                    schemaKey = _schema.tableName;
                }

                schema[schemaKey] = _schema;
            });
            connection.poolMax = 50; // maximum size of the pool
            connection.poolMin = 0; // let the pool shrink completely
            connection.poolIncrement = 1; // only grow the pool by one connection at a time
            connection.poolTimeout = 0;  // never terminate idle connections
            

            // Create pool
            oracledb.createPool(connection,
                    function (err, p) {
                        if (err) {
                            return handleQueryError(err, 'registerConnection');
                        }

                        // Store the connection
                        connections[connection.identity] = {
                            config: connection,
                            collections: collections,
                            schema: schema,
                            pool: p
                        };
                        

                        // Always call describe
                        async.eachSeries(Object.keys(collections), function (colName, cb) {
                            self.describe(connection.identity, colName, cb);
                        }, cb);
                    });

        }
function (connection, collections, cb) {
            if (LOG_DEBUG) {
                console.log("BEGIN registerConnection");
            }
            
            if (!connection.identity)
                return cb(new Error('Connection is missing an identity.'));
            if (connections[connection.identity])
                return cb(new Error('Connection is already registered.'));
            

            var self = this;

            
            connectionOverrides[connection.identity] = {};

            
            if (hop(connection, 'wlNext')) {
                connectionOverrides[connection.identity].wlNext = _.cloneDeep(connection.wlNext);
            }

            
            var schema = {};

            _.each(_.keys(collections), function (coll) {
                var collection = collections[coll];
                if (!collection)
                    return;

                var _schema = collection.waterline && collection.waterline.schema && collection.waterline.schema[collection.identity];
                if (!_schema)
                    return;

                
                if (!_schema.attributes)
                    _schema.attributes = {};
                if (!_schema.tableName)
                    _schema.tableName = coll;

                
                if (!_.includes(collections[coll].connection, connection.identity)) {
                    return;
                }

                
                var schemaKey = coll;
                if (_schema.tableName != coll) {
                    schemaKey = _schema.tableName;
                }

                schema[schemaKey] = _schema;
            });
            connection.poolMax = 50; 
            connection.poolMin = 0; 
            connection.poolIncrement = 1; 
            connection.poolTimeout = 0;  
            

            
            oracledb.createPool(connection,
                    function (err, p) {
                        if (err) {
                            return handleQueryError(err, 'registerConnection');
                        }

                        
                        connections[connection.identity] = {
                            config: connection,
                            collections: collections,
                            schema: schema,
                            pool: p
                        };
                        

                        
                        async.eachSeries(Object.keys(collections), function (colName, cb) {
                            self.describe(connection.identity, colName, cb);
                        }, cb);
                    });

        }
function ( connection , collections , cb ) { if ( LOG_DEBUG ) { console . log ( "BEGIN registerConnection" ) ; } //BEGIN METODO POR DEFECTO if ( ! connection . identity ) return cb ( new Error ( 'Connection is missing an identity.' ) ) ; if ( connections [ connection . identity ] ) return cb ( new Error ( 'Connection is already registered.' ) ) ; //END MÉTODO POR DEFECTO var self = this ; // Store any connection overrides connectionOverrides [ connection . identity ] = { } ; // Look for the WL Next key if ( hop ( connection , 'wlNext' ) ) { connectionOverrides [ connection . identity ] . wlNext = _ . cloneDeep ( connection . wlNext ) ; } // Build up a schema for this connection that can be used throughout the adapter var schema = { } ; _ . each ( _ . keys ( collections ) , function ( coll ) { var collection = collections [ coll ] ; if ( ! collection ) return ; var _schema = collection . waterline && collection . waterline . schema && collection . waterline . schema [ collection . identity ] ; if ( ! _schema ) return ; // Set defaults to ensure values are set if ( ! _schema . attributes ) _schema . attributes = { } ; if ( ! _schema . tableName ) _schema . tableName = coll ; // If the connection names are't the same we don't need it in the schema if ( ! _ . includes ( collections [ coll ] . connection , connection . identity ) ) { return ; } // If the tableName is different from the identity, store the tableName in the schema var schemaKey = coll ; if ( _schema . tableName != coll ) { schemaKey = _schema . tableName ; } schema [ schemaKey ] = _schema ; } ) ; connection . poolMax = 50 ; // maximum size of the pool connection . poolMin = 0 ; // let the pool shrink completely connection . poolIncrement = 1 ; // only grow the pool by one connection at a time connection . poolTimeout = 0 ; // never terminate idle connections // Create pool oracledb . createPool ( connection , function ( err , p ) { if ( err ) { return handleQueryError ( err , 'registerConnection' ) ; } // Store the connection connections [ connection . identity ] = { config : connection , collections : collections , schema : schema , pool : p } ; // Always call describe async . eachSeries ( Object . keys ( collections ) , function ( colName , cb ) { self . describe ( connection . identity , colName , cb ) ; } , cb ) ; } ) ; }
OK

This method runs when a model is initially registered
at server-start-time.  This is the only required method.

@param  {[type]}   connection [description]
@param  {[type]}   collection [description]
@param  {Function} cb         [description]
@return {[type]}              [description]
OK