Module Rubernate
In: rubernate/callbacks.rb
rubernate/impl/dbi_generic.rb
rubernate/impl/dbi_mysql.rb
rubernate/impl/dbi_oracle.rb
rubernate/impl/dbi_pg.rb
rubernate/impl/memory.rb
rubernate/init/init_generic.rb
rubernate/init/init_mysql.rb
rubernate/init/init_oracle.rb
rubernate/init/init_pg.rb
rubernate/lazyload.rb
rubernate/peer.rb
rubernate/persistent.rb
rubernate/queries.rb
rubernate/runtime.rb
rubernate.rb

Contains most useful methods. This module is included in all persistent classes.

Methods

config   dbh   find_by_pk   find_by_query   init_db   runtime   runtime   session   session?  

Classes and Modules

Module Rubernate::Callbacks
Module Rubernate::DBI
Module Rubernate::Persistent
Module Rubernate::Queries
Class Rubernate::DummyPersistent
Class Rubernate::HolderLazyLoader
Class Rubernate::HolderLazyLoaderFactory
Class Rubernate::LazyLoader
Class Rubernate::LazyLoaderFactory
Class Rubernate::ObjectLoadError
Class Rubernate::ObjectNotFoundException
Class Rubernate::ParamLazyLoader
Class Rubernate::ParamLazyLoaderFactory
Class Rubernate::Peer
Class Rubernate::Runtime

Constants

Log = Log4r::Logger.new self.name   Common Rubernate Log instance

Attributes

settings  [R]  Global scope settings

Public Class methods

Performs configuration of Rubernate.

  * db  - database type (:mysql, :oracle).
  * url - url of database.
  * user - databases user name
  * password - databases users password

Intializes database - creates necessary tables, sequences and indices.

Returns Runtime object associated with current session or nil if session does not excists

Begins new session and transaction in database. Returns Runtime object or supply it to block if one is given.

Checks if session exists

Public Instance methods

Shortcut method can be used instead of Rubernate.runtime.dbh Retruns DBI::DatabaseHandle bound to current transaction. This method is optional, some implementation may not implement this method.

Finds object by primary key. This method is actually shortcut to Runtime.find_by_pk

Finds object by query. This method is actually shortcut to Runtime.find_by_query Retruns array of objects, accepts native sql or query language expressions. If query is sql then params should be array as in DBI. Else it should be Hash of {:maker=>value}.

     Rubernate.find_by_query 'Select :p; Where p.name.str == :name', :name => 'Andy'

     #Or the same using native sql.
     Rubernate.find_by_query  "select p_.* from r_objects p_ left outer join  r_params p_name
            on (p_.object_pk = p_name.object_pk)
        where p_name.name = 'name' and p_name.str_value = ?", ['Andy']

Returns current runtime object.

[Validate]