Class: Ea::Qea::Models::EaObjectConstraint

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/ea/qea/models/ea_object_constraint.rb

Overview

EA Object Constraint model

Represents OCL constraints attached to UML objects in the t_objectconstraint table.

Examples:

Create from database row

row = {
  "Object_ID" => 4,
  "Constraint" => "count(self.legalConstraints) >= 1",
  "ConstraintType" => "Invariant",
  "Weight" => "0.0",
  "Notes" => nil,
  "Status" => "Approved"
}
constraint = EaObjectConstraint.from_db_row(row)

Constant Summary collapse

COLUMN_MAP =
{
  "ConstraintID" => :constraint_id,
  "Object_ID" => :ea_object_id,
  "ConstraintType" => :constraint_type,
}.freeze

Class Method Summary collapse

Methods inherited from BaseModel

from_db_row, #primary_key, #sort_position

Class Method Details

.column_mapObject



47
48
49
# File 'lib/ea/qea/models/ea_object_constraint.rb', line 47

def self.column_map
  COLUMN_MAP
end

.primary_key_columnSymbol

Returns Primary key column name.

Returns:

  • (Symbol)

    Primary key column name



31
32
33
# File 'lib/ea/qea/models/ea_object_constraint.rb', line 31

def self.primary_key_column
  :constraint_id
end

.table_nameString

Returns Database table name.

Returns:

  • (String)

    Database table name



36
37
38
# File 'lib/ea/qea/models/ea_object_constraint.rb', line 36

def self.table_name
  "t_objectconstraint"
end