Class ::xo::db::sql::acs_rel_type

::xo::db::sql::acs_rel_type[i] create ...

Defined in

Class Relations

  • class: ::xo::db::Class[i]
  • superclass: ::xotcl::Object[i]
::xo::db::Class create ::xo::db::sql::acs_rel_type \
     -superclass ::xotcl::Object

Methods (to be applied on the object)

  • create_role (scripted, public)

     xo::db::sql::acs_rel_type[i] create_role [ -dbn dbn ] -role role  \
        [ -pretty_name pretty_name ] [ -pretty_plural pretty_plural ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -role (required)
    -pretty_name (optional)
    -pretty_plural (optional)

    Testcases:
    No testcase defined.
    #function_args: {ROLE {}} {PRETTY_NAME null} {PRETTY_PLURAL null}
    foreach var [list ROLE PRETTY_NAME PRETTY_PLURAL]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select acs_rel_type__create_role($_ROLE$_PRETTY_NAME$_PRETTY_PLURAL) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • create_type (scripted, public)

     xo::db::sql::acs_rel_type[i] create_type [ -dbn dbn ] -rel_type rel_type  \
        -pretty_name pretty_name  -pretty_plural pretty_plural  \
        [ -supertype supertype ] -table_name table_name  \
        -id_column id_column  -package_name package_name  \
        -object_type_one object_type_one  [ -role_one role_one ] \
        -min_n_rels_one min_n_rels_one  -max_n_rels_one max_n_rels_one  \
        -object_type_two object_type_two  [ -role_two role_two ] \
        -min_n_rels_two min_n_rels_two  -max_n_rels_two max_n_rels_two  \
        [ -composable_p composable_p ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -rel_type (required)
    -pretty_name (required)
    -pretty_plural (required)
    -supertype (optional, defaults to "relationship")
    -table_name (required)
    -id_column (required)
    -package_name (required)
    -object_type_one (required)
    -role_one (optional)
    -min_n_rels_one (required)
    -max_n_rels_one (required)
    -object_type_two (required)
    -role_two (optional)
    -min_n_rels_two (required)
    -max_n_rels_two (required)
    -composable_p (optional, defaults to "t")

    Testcases:
    No testcase defined.
    #function_args: {REL_TYPE {}} {PRETTY_NAME {}} {PRETTY_PLURAL {}} {SUPERTYPE relationship} {TABLE_NAME {}} {ID_COLUMN {}} {PACKAGE_NAME {}} {OBJECT_TYPE_ONE {}} {ROLE_ONE null} {MIN_N_RELS_ONE {}} {MAX_N_RELS_ONE {}} {OBJECT_TYPE_TWO {}} {ROLE_TWO null} {MIN_N_RELS_TWO {}} {MAX_N_RELS_TWO {}} {COMPOSABLE_P t}
    foreach var [list REL_TYPE PRETTY_NAME PRETTY_PLURAL SUPERTYPE TABLE_NAME ID_COLUMN PACKAGE_NAME OBJECT_TYPE_ONE ROLE_ONE MIN_N_RELS_ONE MAX_N_RELS_ONE OBJECT_TYPE_TWO ROLE_TWO MIN_N_RELS_TWO MAX_N_RELS_TWO COMPOSABLE_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_rel_type__create_type($_REL_TYPE$_PRETTY_NAME$_PRETTY_PLURAL$_SUPERTYPE$_TABLE_NAME$_ID_COLUMN$_PACKAGE_NAME$_OBJECT_TYPE_ONE$_ROLE_ONE$_MIN_N_RELS_ONE$_MAX_N_RELS_ONE$_OBJECT_TYPE_TWO$_ROLE_TWO$_MIN_N_RELS_TWO$_MAX_N_RELS_TWO$_COMPOSABLE_P) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • drop_role (scripted, public)

     xo::db::sql::acs_rel_type[i] drop_role [ -dbn dbn ] -role role 

    Automatically generated method

    Switches:
    -dbn (optional)
    -role (required)

    Testcases:
    No testcase defined.
    #function_args: {ROLE {}}
    foreach var [list ROLE]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select acs_rel_type__drop_role($_ROLE) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • drop_type (scripted, public)

     xo::db::sql::acs_rel_type[i] drop_type [ -dbn dbn ] -rel_type rel_type  \
        [ -cascade_p cascade_p ]

    Automatically generated method

    Switches:
    -dbn (optional)
    -rel_type (required)
    -cascade_p (optional, defaults to "f")

    Testcases:
    No testcase defined.
    #function_args: {REL_TYPE {}} {CASCADE_P f}
    foreach var [list REL_TYPE CASCADE_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_rel_type__drop_type($_REL_TYPE$_CASCADE_P) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • role_pretty_name (scripted, public)

     xo::db::sql::acs_rel_type[i] role_pretty_name [ -dbn dbn ] -role role 

    Automatically generated method

    Switches:
    -dbn (optional)
    -role (required)

    Testcases:
    No testcase defined.
    #function_args: {ROLE {}}
    foreach var [list ROLE]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select acs_rel_type__role_pretty_name($_ROLE) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }
  • role_pretty_plural (scripted, public)

     xo::db::sql::acs_rel_type[i] role_pretty_plural [ -dbn dbn ] -role role 

    Automatically generated method

    Switches:
    -dbn (optional)
    -role (required)

    Testcases:
    No testcase defined.
    #function_args: {ROLE {}}
    foreach var [list ROLE]  {
      set varname [string tolower $var]
      if {[info exists $varname]} {
        set $var [set $varname]
        set _$var :$var
      } else {
        set _$var null
      }
    }
    set sql "
    select acs_rel_type__role_pretty_plural($_ROLE) 
        "
    db_with_handle -dbn $dbn db {
      #ns_log notice "--sql=$sql"
      return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
    }