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
45 46 47 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 45 def self.primary_key_column :datatypeid end |
.table_name ⇒ Object
41 42 43 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 41 def self.table_name "t_datatypes" end |
Instance Method Details
#code_type? ⇒ Boolean
Check if this is a Code type
57 58 59 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 57 def code_type? type == "Code" end |
#ddl_type? ⇒ Boolean
Check if this is a DDL type
51 52 53 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 51 def ddl_type? type == "DDL" end |
#has_length? ⇒ Boolean
Check if type has length parameter
69 70 71 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 69 def has_length? size == 1 || !haslength.nil? end |
#has_precision? ⇒ Boolean
Check if type has precision parameter
75 76 77 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 75 def has_precision? size == 2 end |
#type_signature ⇒ String
Get full type signature with size/precision
81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 81 def type_signature case size when 0 datatype when 1 "#{datatype}(#{defaultlen})" when 2 "#{datatype}(#{defaultprec},#{defaultscale})" else datatype end end |
#user_defined? ⇒ Boolean
Check if this is a user-defined type
63 64 65 |
# File 'lib/lutaml/qea/models/ea_datatype.rb', line 63 def user_defined? user == 1 end |