Exemplo n.º 1
0
 public IntermediateHqlTree(bool root, QueryMode mode)
 {
     _isRoot     = root;
     TreeBuilder = new HqlTreeBuilder();
     if (mode == QueryMode.Delete)
     {
         _root = TreeBuilder.Delete(TreeBuilder.From());
     }
     else if (mode == QueryMode.Update)
     {
         _root = TreeBuilder.Update(TreeBuilder.From(), TreeBuilder.Set());
     }
     else if (mode == QueryMode.UpdateVersioned)
     {
         _root = TreeBuilder.Update(TreeBuilder.Versioned(), TreeBuilder.From(), TreeBuilder.Set());
     }
     else if (mode == QueryMode.Insert)
     {
         _root       = TreeBuilder.Query(TreeBuilder.SelectFrom(TreeBuilder.From()));
         _insertRoot = TreeBuilder.Insert(TreeBuilder.Into(), _root as HqlQuery);
     }
     else
     {
         _root = TreeBuilder.Query(TreeBuilder.SelectFrom(TreeBuilder.From()));
     }
 }