Class Rubernate::DBI::Runtime
In: rubernate/impl/dbi_generic.rb
Parent: Rubernate::Runtime
 Represent base class for all Runtime implementation.
 Contains generic sql implementations of all required methods except create.

Method create should be implemented in subclasses.

Methods

close   delete   failed   load_by_pk   load_by_query   new   save  

Included Modules

DBI

Constants

DELETE_PARAMS = <<-SQL DELETE FROM R_PARAMS WHERE OBJECT_PK = ? SQL   In some implementations parameters are deleted automatically with corresponding r_object records
DELETE_PARAMS_FOR = <<-SQL DELETE FROM R_PARAMS WHERE OBJECT_PK IN SQL
DELETE_OBJECT = <<-SQL DELETE FROM R_OBJECTS WHERE OBJECT_PK = ? SQL
CREATE_PEER = <<-SQL INSERT INTO R_OBJECTS (OBJECT_PK, OBJECT_CLASS) values (?, ?) SQL
SAVE_PARAMS = <<-SQL INSERT INTO R_PARAMS VALUES (?, ?, ?, ?, ?, ?, ?, ?) SQL
SELECT_PARAMS = <<-SQL SELECT P.*, R.OBJECT_CLASS, O.OBJECT_CLASS FROM R_PARAMS P JOIN R_OBJECTS O ON (O.OBJECT_PK = P.OBJECT_PK) LEFT OUTER JOIN R_OBJECTS R ON (P.REF_VALUE = R.OBJECT_PK) WHERE O.OBJECT_PK IN SQL
SELECT_ONE_OBJECT = <<-SQL SELECT O.OBJECT_PK, P.NAME, P.FLAGS, P.INT_VALUE, P.FLT_VALUE, P.STR_VALUE, P.DAT_VALUE, P.REF_VALUE, R.OBJECT_CLASS, O.OBJECT_CLASS FROM R_OBJECTS O LEFT OUTER JOIN R_PARAMS P ON (O.OBJECT_PK = P.OBJECT_PK) LEFT OUTER JOIN R_OBJECTS R ON (P.REF_VALUE = R.OBJECT_PK) WHERE O.OBJECT_PK = ? SQL
P_REF_CLASS = 8   Adition columns for R_PARAMS table joined …
P_CLASS = 9

Attributes

dbh  [R] 

Public Class methods

Public Instance methods

Deletes object from database

Loads object by primary_key

Loads objects by query with specified params.

Updates object state in database

[Validate]