Class: Lutaml::Qea::Models::EaDatatype
- Defined in:
- lib/lutaml/qea/models/ea_datatype.rb
Overview
Represents a data type definition from t_datatypes table
This table stores database-specific type definitions and mappings. It maps database vendor types (e.g., “VARCHAR2” in Oracle) to generic types (e.g., “varchar”). This is metadata for database schema generation, not UML DataType instances.
Class Method Summary collapse
Instance Method Summary collapse
-
#code_type? ⇒ Boolean
Check if this is a Code type.
-
#ddl_type? ⇒ Boolean
Check if this is a DDL type.
-
#has_length? ⇒ Boolean
Check if type has length parameter.
-
#has_precision? ⇒ Boolean
Check if type has precision parameter.
-
#type_signature ⇒ String
Get full type signature with size/precision.
-
#user_defined? ⇒ Boolean
Check if this is a user-defined type.
Methods inherited from BaseModel
Class Method Details
.primary_key_column ⇒ Object
43 44 45 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 43 def self.primary_key_column :datatypeid end |
.table_name ⇒ Object
39 40 41 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 39 def self.table_name "t_datatypes" end |
Instance Method Details
#code_type? ⇒ Boolean
Check if this is a Code type
55 56 57 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 55 def code_type? type == "Code" end |
#ddl_type? ⇒ Boolean
Check if this is a DDL type
49 50 51 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 49 def ddl_type? type == "DDL" end |
#has_length? ⇒ Boolean
Check if type has length parameter
67 68 69 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 67 def has_length? size == 1 || !haslength.nil? end |
#has_precision? ⇒ Boolean
Check if type has precision parameter
73 74 75 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 73 def has_precision? size == 2 end |
#type_signature ⇒ String
Get full type signature with size/precision
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 79 def type_signature case size when 1 "#{datatype}(#{defaultlen})" when 2 "#{datatype}(#{defaultprec},#{defaultscale})" else datatype end end |
#user_defined? ⇒ Boolean
Check if this is a user-defined type
61 62 63 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 61 def user_defined? user == 1 end |