Class: OCI8::Metadata::Type
Overview
Information about types
An instance of this class is returned by:
-
OCI8#describe_any(name)
-
OCI8#describe_type(name)
-
OCI8::Metadata::Schema#all_objects
-
OCI8::Metadata::Schema#objects
Instance Method Summary collapse
-
#collection_element ⇒ OCI8::Metadata::Collection or nil
Returns element information of the collection type if the type is a nested table or a varray.
-
#collection_typecode ⇒ :table, :varray or nil
Returns
:table
if the type is a nested table,:varray
if it is a varray. -
#has_file? ⇒ Boolean
Returns
true
if the type has a BFILE attribute. -
#has_lob? ⇒ Boolean
Returns
true
if the type has a CLOB, NCLOB or BLOB attribute. -
#has_nested_table? ⇒ Boolean
Returns
true
if the type is a nested table or has a nested table attribute. -
#inspect ⇒ Object
:nodoc:.
-
#is_final_type? ⇒ Boolean
Returns
true
if the type is a final type; in other words, subtypes cannot be derived from the type. -
#is_incomplete_type? ⇒ Boolean
Returns
true
if the type is an incomplete type, which is used for forward declaration. - #is_instantiable_type? ⇒ Boolean
-
#is_invoker_rights? ⇒ Boolean
Returns
true
if the type has invoker’s rights. -
#is_predefined_type? ⇒ Boolean
Always returns
false
. -
#is_subtype? ⇒ Boolean
Returns
true
if the type is a subtype. -
#is_system_generated_type? ⇒ Boolean
Always returns
false
. -
#is_system_type? ⇒ Boolean
Always returns
false
because there is no way to create a type metadata object for a system type such asNUMBER
,CHAR
andVARCHAR
. -
#is_transient_type? ⇒ Boolean
Always returns
false
because there is no way to create a type metadata object for a transient type, which is a type dynamically created by C API. -
#map_method ⇒ OCI8::Metadata::TypeMethod or nil
Returns information of the map method if it is defined in the type.
-
#name ⇒ String
Returns the type name.
-
#num_type_attrs ⇒ Integer
Returns number of type attributes.
-
#num_type_methods ⇒ Integer
Returns number of type methods.
-
#order_method ⇒ OCI8::Metadata::TypeMethod or nil
Returns information of the order method if it is defined in the type.
-
#package_name ⇒ String or nil
Returns the package name if the type is a package type.
-
#schema_name ⇒ String
Returns the schema name where the type has been created.
-
#supertype_name ⇒ String or nil
Returns the supertype’s name if the type is a subtype.
-
#supertype_schema_name ⇒ String or nil
Returns the supertype’s schema name if the type is a subtype.
-
#type_attrs ⇒ array of OCI8::Metadata::TypeAttr
Returns attribute information of the type.
-
#type_metadata ⇒ Object
to type metadata if possible.
-
#type_methods ⇒ array of OCI8::Metadata::TypeMethod
Returns method information of the type.
-
#typecode ⇒ :named_type or :named_collection
Returns
:named_type
if the type is an object type,:named_collection
if it is a nested table or a varray.
Methods inherited from Base
#obj_id, #obj_link, #obj_name, #obj_schema
Instance Method Details
#collection_element ⇒ OCI8::Metadata::Collection or nil
Returns element information of the collection type if the type is a nested table or a varray. Otherwise, nil
.
787 788 789 |
# File 'lib/oci8/metadata.rb', line 787 def collection_element __param(OCI_ATTR_COLLECTION_ELEMENT) if typecode == :named_collection end |
#collection_typecode ⇒ :table, :varray or nil
Returns :table
if the type is a nested table, :varray
if it is a varray. Otherwise, nil
.
721 722 723 |
# File 'lib/oci8/metadata.rb', line 721 def collection_typecode __typecode(OCI_ATTR_COLLECTION_TYPECODE) if typecode == :named_collection end |
#has_file? ⇒ Boolean
Returns true
if the type has a BFILE attribute. Otherwise, false
.
778 779 780 |
# File 'lib/oci8/metadata.rb', line 778 def has_file? attr_get_ub1(OCI_ATTR_HAS_FILE) != 0 end |
#has_lob? ⇒ Boolean
Returns true
if the type has a CLOB, NCLOB or BLOB attribute. Otherwise, false
.
772 773 774 |
# File 'lib/oci8/metadata.rb', line 772 def has_lob? attr_get_ub1(OCI_ATTR_HAS_LOB) != 0 end |
#has_nested_table? ⇒ Boolean
Returns true
if the type is a nested table or has a nested table attribute. Otherwise, false
.
765 766 767 |
# File 'lib/oci8/metadata.rb', line 765 def has_nested_table? attr_get_ub1(OCI_ATTR_HAS_NESTED_TABLE) != 0 end |
#inspect ⇒ Object
:nodoc:
917 918 919 |
# File 'lib/oci8/metadata.rb', line 917 def inspect # :nodoc: "#<#{self.class.name}:(#{obj_id}) #{schema_name}.#{name}>" end |
#is_final_type? ⇒ Boolean
Returns true
if the type is a final type; in other words, subtypes cannot be derived from the type. Otherwise, false
.
860 861 862 |
# File 'lib/oci8/metadata.rb', line 860 def is_final_type? attr_get_ub1(OCI_ATTR_IS_FINAL_TYPE) != 0 end |
#is_incomplete_type? ⇒ Boolean
Returns true
if the type is an incomplete type, which is used for forward declaration. Otherwise, false
.
729 730 731 |
# File 'lib/oci8/metadata.rb', line 729 def is_incomplete_type? attr_get_ub1(OCI_ATTR_IS_INCOMPLETE_TYPE) != 0 end |
#is_instantiable_type? ⇒ Boolean
867 868 869 |
# File 'lib/oci8/metadata.rb', line 867 def is_instantiable_type? attr_get_ub1(OCI_ATTR_IS_INSTANTIABLE_TYPE) != 0 end |
#is_invoker_rights? ⇒ Boolean
Returns true
if the type has invoker’s rights. Otherwise, false
.
838 839 840 |
# File 'lib/oci8/metadata.rb', line 838 def is_invoker_rights? attr_get_ub1(OCI_ATTR_IS_INVOKER_RIGHTS) != 0 end |
#is_predefined_type? ⇒ Boolean
Always returns false
. – I don’t know the definition of predefined type…
743 744 745 |
# File 'lib/oci8/metadata.rb', line 743 def is_predefined_type? # :nodoc: attr_get_ub1(OCI_ATTR_IS_PREDEFINED_TYPE) != 0 end |
#is_subtype? ⇒ Boolean
Returns true
if the type is a subtype. Otherwise, false
.
874 875 876 |
# File 'lib/oci8/metadata.rb', line 874 def is_subtype? attr_get_ub1(OCI_ATTR_IS_SUBTYPE) != 0 end |
#is_system_generated_type? ⇒ Boolean
Always returns false
. – I don’t know the definition of system generated type. What is different with system type and predefined type.
758 759 760 |
# File 'lib/oci8/metadata.rb', line 758 def is_system_generated_type? # :nodoc: attr_get_ub1(OCI_ATTR_IS_SYSTEM_GENERATED_TYPE) != 0 end |
#is_system_type? ⇒ Boolean
Always returns false
because there is no way to create a type metadata object for a system type such as NUMBER
, CHAR
and VARCHAR
.
736 737 738 |
# File 'lib/oci8/metadata.rb', line 736 def is_system_type? # :nodoc: attr_get_ub1(OCI_ATTR_IS_SYSTEM_TYPE) != 0 end |
#is_transient_type? ⇒ Boolean
Always returns false
because there is no way to create a type metadata object for a transient type, which is a type dynamically created by C API.
750 751 752 |
# File 'lib/oci8/metadata.rb', line 750 def is_transient_type? # :nodoc: attr_get_ub1(OCI_ATTR_IS_TRANSIENT_TYPE) != 0 end |
#map_method ⇒ OCI8::Metadata::TypeMethod or nil
Returns information of the map method if it is defined in the type. Otherwise, nil
.
822 823 824 |
# File 'lib/oci8/metadata.rb', line 822 def map_method __param(OCI_ATTR_MAP_METHOD) end |
#name ⇒ String
Returns the type name.
845 846 847 |
# File 'lib/oci8/metadata.rb', line 845 def name attr_get_string(OCI_ATTR_NAME) end |
#num_type_attrs ⇒ Integer
Returns number of type attributes.
794 795 796 |
# File 'lib/oci8/metadata.rb', line 794 def num_type_attrs attr_get_ub2(OCI_ATTR_NUM_TYPE_ATTRS) end |
#num_type_methods ⇒ Integer
Returns number of type methods.
807 808 809 |
# File 'lib/oci8/metadata.rb', line 807 def num_type_methods attr_get_ub2(OCI_ATTR_NUM_TYPE_METHODS) end |
#order_method ⇒ OCI8::Metadata::TypeMethod or nil
Returns information of the order method if it is defined in the type. Otherwise, nil
.
831 832 833 |
# File 'lib/oci8/metadata.rb', line 831 def order_method __param(OCI_ATTR_ORDER_METHOD) end |
#package_name ⇒ String or nil
Returns the package name if the type is a package type. Otherwise, nil
.
899 900 901 |
# File 'lib/oci8/metadata.rb', line 899 def package_name attr_get_string(12, false) # OCI_ATTR_PACKAGE_NAME end |
#schema_name ⇒ String
Returns the schema name where the type has been created.
852 853 854 |
# File 'lib/oci8/metadata.rb', line 852 def schema_name attr_get_string(OCI_ATTR_SCHEMA_NAME) end |
#supertype_name ⇒ String or nil
Returns the supertype’s name if the type is a subtype. Otherwise, nil
.
890 891 892 |
# File 'lib/oci8/metadata.rb', line 890 def supertype_name attr_get_string(OCI_ATTR_SUPERTYPE_NAME) if is_subtype? end |
#supertype_schema_name ⇒ String or nil
Returns the supertype’s schema name if the type is a subtype. Otherwise, nil
.
882 883 884 |
# File 'lib/oci8/metadata.rb', line 882 def supertype_schema_name attr_get_string(OCI_ATTR_SUPERTYPE_SCHEMA_NAME) if is_subtype? end |
#type_attrs ⇒ array of OCI8::Metadata::TypeAttr
Returns attribute information of the type.
906 907 908 |
# File 'lib/oci8/metadata.rb', line 906 def type_attrs @type_attrs ||= list_type_attrs.to_a end |
#type_metadata ⇒ Object
to type metadata if possible
705 706 707 |
# File 'lib/oci8/metadata.rb', line 705 def self end |
#type_methods ⇒ array of OCI8::Metadata::TypeMethod
Returns method information of the type.
913 914 915 |
# File 'lib/oci8/metadata.rb', line 913 def type_methods @type_methods ||= list_type_methods.to_a end |
#typecode ⇒ :named_type or :named_collection
Returns :named_type
if the type is an object type, :named_collection
if it is a nested table or a varray.
713 714 715 |
# File 'lib/oci8/metadata.rb', line 713 def typecode __typecode(OCI_ATTR_TYPECODE) end |