Class ::xo::db::sql::acs_object_type (public)
::xo::db::Class ::xo::db::sql::acs_object_type
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::acs_object_type {set :__default_metaclass ::xotcl::Class
set :__default_superclass ::xotcl::Object
set :abstract_p f
set :auto_save false
set :name_method {}
set :object_type ::xo::db::sql::acs_object_type
set :security_inherit_p t
set :sql_package_name acs_object_type
set :supertype acs_object
set :with_table true}
::xo::db::sql::acs_object_type proc pretty_name {{-dbn {}} -object_type:required} {
foreach var [list OBJECT_TYPE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object_type__pretty_name($_OBJECT_TYPE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object_type proc create_type {{-dbn {}} -object_type:required -pretty_name:required -pretty_plural:required -supertype:required -table_name -id_column -package_name {-abstract_p f} -type_extension_table -name_method {-create_table_p f} {-dynamic_p f}} {
foreach var [list OBJECT_TYPE PRETTY_NAME PRETTY_PLURAL SUPERTYPE TABLE_NAME ID_COLUMN PACKAGE_NAME ABSTRACT_P TYPE_EXTENSION_TABLE NAME_METHOD CREATE_TABLE_P DYNAMIC_P] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object_type__create_type($_OBJECT_TYPE, $_PRETTY_NAME, $_PRETTY_PLURAL, $_SUPERTYPE, $_TABLE_NAME, $_ID_COLUMN, $_PACKAGE_NAME, $_ABSTRACT_P, $_TYPE_EXTENSION_TABLE, $_NAME_METHOD, $_CREATE_TABLE_P, $_DYNAMIC_P)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object_type proc drop_type {{-dbn {}} -object_type:required {-drop_children_p f} {-drop_table_p f}} {
foreach var [list OBJECT_TYPE DROP_CHILDREN_P DROP_TABLE_P] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object_type__drop_type($_OBJECT_TYPE, $_DROP_CHILDREN_P, $_DROP_TABLE_P)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_object_type proc is_subtype_p {{-dbn {}} -object_type_1:required -object_type_2:required} {
foreach var [list OBJECT_TYPE_1 OBJECT_TYPE_2] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_object_type__is_subtype_p($_OBJECT_TYPE_1, $_OBJECT_TYPE_2)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]