class Lutaml::Qea::Models::EaObjectConstraint

constraint = EaObjectConstraint.from_db_row(row)
}
“Status” => “Approved”
“Notes” => nil,
“Weight” => “0.0”,
“ConstraintType” => “Invariant”,
“Constraint” => “count(self.legalConstraints) >= 1”,
“Object_ID” => 4,
row = {
@example Create from database row
t_objectconstraint table.
Represents OCL constraints attached to UML objects in the
EA Object Constraint model

def self.from_db_row(row)

Returns:
  • (EaObjectConstraint, nil) - New instance or nil if row is nil

Parameters:
  • row (Hash) -- Database row with string keys
def self.from_db_row(row)
  return nil if row.nil?
  new(
    constraint_id: row["ConstraintID"],
    ea_object_id: row["Object_ID"],
    constraint: row["Constraint"],
    constraint_type: row["ConstraintType"],
    weight: row["Weight"]&.to_f,
    notes: row["Notes"],
    status: row["Status"],
  )
end

def self.primary_key_column

Returns:
  • (Symbol) - Primary key column name
def self.primary_key_column
  :constraint_id
end

def self.table_name

Returns:
  • (String) - Database table name
def self.table_name
  "t_objectconstraint"
end