xo::db::Class instproc instantiate_objects (public)
<instance of xo::db::Class> instantiate_objects [ -dbn dbn ] \ [ -sql sql ] [ -full_statement_name full_statement_name ] \ [ -as_ordered_composite on|off ] [ -object_class object_class ] \ [ -named_objects on|off ] \ [ -object_named_after object_named_after ] \ [ -destroy_on_cleanup on|off ] [ -keep_existing_objects on|off ] \ [ -ignore_missing_package_ids on|off ] [ -initialize initialize ]
Defined in /var/www/openacs.org/packages/xotcl-core/tcl/05-db-procs.tcl
Retrieve multiple objects from the database using the given SQL query and create XOTcl objects from the tuples.
- Switches:
- -dbn (optional)
- -sql (optional)
- The SQL query to retrieve tuples. Note that if the SQL query only returns a restricted set of attributes, the objects will be only partially instantiated.
- -full_statement_name (optional)
- -as_ordered_composite (optional, boolean, defaults to
"true"
)- return an ordered composite object preserving the order. If the flag is false, one has to use "info instances" to access the resulted objects.
- -object_class (optional, defaults to
"::xotcl::Object"
)- specifies the XOTcl class, for which instances are created.
- -named_objects (optional, boolean, defaults to
"false"
)- If this flag is true, the value of the id_column is used for the name of the created objects (object will be named e.g. ::13738). Otherwise, objects are created with the XOTcl "new" method to avoid object name clashes.
- -object_named_after (optional)
- -destroy_on_cleanup (optional, boolean, defaults to
"true"
)- If this flag is true, the objects (and ordered composite) will be automatically destroyed on cleanup (typically after the request was processed).
- -keep_existing_objects (optional, boolean, defaults to
"false"
)- -ignore_missing_package_ids (optional, boolean, defaults to
"false"
)- -initialize (optional, defaults to
"true"
)- can be used to avoid full initialization, when a large series of objects is loaded. Per default, these objects are initialized via initialize_loaded_object, when the are of type ::xo::db::Object
- Testcases:
- xowiki_test_cases