Should return an SQLSelectTableJoins object containing the table
or tables to be joined to the primary table. This function is useful in
optimising database loading speeds by allowing multiple tables to be joined into
one data set. The resultant data set can then be used to load
objects from the associated tables avoiding subsequent SQL calls. For a complete
example, see the demonstration program.
Should return Nothing if no table joins are required.
Implementing this function is optional.
Namespace: DatabaseObjectsAssembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0
Syntax
C# |
---|
SQLSelectTableJoins TableJoins( SQLSelectTable objPrimaryTable, SQLSelectTables objTables ) |
Visual Basic |
---|
Function TableJoins ( _ objPrimaryTable As SQLSelectTable, _ objTables As SQLSelectTables _ ) As SQLSelectTableJoins |
Visual C++ |
---|
SQLSelectTableJoins^ TableJoins( SQLSelectTable^ objPrimaryTable, SQLSelectTables^ objTables ) |
Parameters
- objPrimaryTable
- Type: DatabaseObjects.SQL..::..SQLSelectTable
[Missing <param name="objPrimaryTable"/> documentation for "M:DatabaseObjects.IDatabaseObjects.TableJoins(DatabaseObjects.SQL.SQLSelectTable,DatabaseObjects.SQL.SQLSelectTables)"]
- objTables
- Type: DatabaseObjects.SQL..::..SQLSelectTables
[Missing <param name="objTables"/> documentation for "M:DatabaseObjects.IDatabaseObjects.TableJoins(DatabaseObjects.SQL.SQLSelectTable,DatabaseObjects.SQL.SQLSelectTables)"]
Return Value
[Missing <returns> documentation for "M:DatabaseObjects.IDatabaseObjects.TableJoins(DatabaseObjects.SQL.SQLSelectTable,DatabaseObjects.SQL.SQLSelectTables)"]
Examples
CopyC#
Protected Function TableJoins(ByVal objPrimaryTable As SQL.SQLSelectTable, ByVal objTables As SQL.SQLSelectTables) As SQL.SQLSelectTableJoins Implements IDatabaseObjects.TableJoins 'Implementing this function is optional, but is useful when attempting to optimise loading speeds. 'This function is used by the ObjectsList, Object, ObjectByKey, ObjectOrdinal and ObjectSearch functions. 'If this function has been implemented Search can also search fields in the joined table(s). 'In this example, the Products table will always be joined with the Supplier table. We could also join the Products 'table to the Category table, however the Product.Category property is not used often enough to warrant 'always joining the category table whenever loading a product. Of course, you can always join different 'tables in different situations, for example you might want join to other tables when searching and to 'not join other tables in normal circumstances. Dim objTableJoins As SQL.SQLSelectTableJoins = New SQL.SQLSelectTableJoins With objTableJoins.Add(objPrimaryTable, SQL.SQLSelectTableJoin.Type.Inner, objTables.Add("Suppliers")) .Where.Add("SupplierID", SQL.ComparisonOperator.EqualTo, "SupplierID") End With With objTableJoins.Add(objPrimaryTable, SQL.SQLSelectTableJoin.Type.Inner, objTables.Add("Categories")) .Where.Add("CategoryID", SQL.ComparisonOperator.EqualTo, "CategoryID") End With Return objTableJoins End Function