DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | List of all members
Deveel.Data.Sql.Query.LeftOuterJoinNode Class Reference

A branch node for a left outer join. More...

Inheritance diagram for Deveel.Data.Sql.Query.LeftOuterJoinNode:
Deveel.Data.Sql.Query.SingleQueryPlanNode Deveel.Data.Sql.Query.IQueryPlanNode Deveel.Data.Serialization.ISerializable

Public Member Functions

 LeftOuterJoinNode (IQueryPlanNode child, string markerName)
 
override ITable Evaluate (IRequest context)
 

Protected Member Functions

override void GetData (SerializeData data)
 
- Protected Member Functions inherited from Deveel.Data.Sql.Query.SingleQueryPlanNode
 SingleQueryPlanNode (IQueryPlanNode child)
 
 SingleQueryPlanNode (ObjectData data)
 

Properties

string MarkerName [get, private set]
 
- Properties inherited from Deveel.Data.Sql.Query.SingleQueryPlanNode
IQueryPlanNode Child [get, private set]
 Gets the single child node of the plan. More...
 

Private Member Functions

 LeftOuterJoinNode (ObjectData data)
 

Detailed Description

A branch node for a left outer join.

Using this node is a little non-intuitive. This node will only work when used in conjuction with MarkerNode.

To use - first the complete left table in the join must be marked with a name. Then the on expression is evaluated to a single plan node. Then this plan node must be added to result in a left outer join. A tree for a left outer join may look as follows:

|
Join a = b
/ \
Marker GetTable T2
|
GetTable T1

Definition at line 48 of file LeftOuterJoinNode.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Query.LeftOuterJoinNode.LeftOuterJoinNode ( IQueryPlanNode  child,
string  markerName 
)
inline

Definition at line 49 of file LeftOuterJoinNode.cs.

50  : base(child) {
51  MarkerName = markerName;
52  }
Deveel.Data.Sql.Query.LeftOuterJoinNode.LeftOuterJoinNode ( ObjectData  data)
inlineprivate

Definition at line 54 of file LeftOuterJoinNode.cs.

55  : base(data) {
56  MarkerName = data.GetString("Marker");
57  }

Member Function Documentation

override ITable Deveel.Data.Sql.Query.LeftOuterJoinNode.Evaluate ( IRequest  context)
inlinevirtual

Implements Deveel.Data.Sql.Query.SingleQueryPlanNode.

Definition at line 61 of file LeftOuterJoinNode.cs.

61  {
62  // Evaluate the child branch,
63  var result = Child.Evaluate(context);
64  // Get the table of the complete mark name,
65  var completeLeft = context.Query.GetCachedTable(MarkerName);
66 
67  // The rows in 'complete_left' that are outside (not in) the rows in the
68  // left result.
69  var outside = completeLeft.OuterJoin(result);
70 
71  // Create an OuterTable
72  var outerTable = OuterTable.Create(result);
73  outerTable.MergeIn(outside);
74 
75  // Return the outer table
76  return outerTable;
77  }
ITable Evaluate(IRequest context)
IQueryPlanNode Child
Gets the single child node of the plan.
static OuterTable Create(ITable inputTable)
Definition: OuterTable.cs:32
void MergeIn(ITable outsideTable)
Definition: OuterTable.cs:44
override void Deveel.Data.Sql.Query.LeftOuterJoinNode.GetData ( SerializeData  data)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Sql.Query.SingleQueryPlanNode.

Definition at line 79 of file LeftOuterJoinNode.cs.

79  {
80  data.SetValue("Marker", MarkerName);
81  }
void SetValue(string key, Type type, object value)

Property Documentation

string Deveel.Data.Sql.Query.LeftOuterJoinNode.MarkerName
getprivate set

Definition at line 59 of file LeftOuterJoinNode.cs.


The documentation for this class was generated from the following file: