KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > query > api > NestQueryNode


1 /**
2  * MEDOR: Middleware Enabling Distributed Object Requests
3  *
4  * Copyright (C) 2001-2005 France Telecom R&D
5  * Contact: alexandre.lefebvre@rd.francetelecom.com
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  *
21  * Initial developers: M. Alia, A. Lefebvre
22  */

23
24 package org.objectweb.medor.query.api;
25
26 import org.objectweb.medor.api.MedorException;
27 import org.objectweb.medor.api.Field;
28
29 /**
30  * All nesting fields (group by) are projected. As an example, it is NOT possible to do
31  * select a from r group by a, b.
32  * This operation must be decomposed into select a, b from r group by a, b
33  * followed by select a from result.
34  * @author Sebastien Chassande-Barrioz
35  */

36 public interface NestQueryNode extends QueryNode {
37
38     /**
39      * Creates and adds a NestedField to the TupleStructure of the
40      * QueryNode.
41      * @param name is the name of the Field to be added.
42      * @param anc are the grouped Fields for the NestedField to be created.
43      * @return the newly created NestedField
44      * @throws MedorException when a Field with the same name already exists.
45      */

46     NestedField replaceNestedField(String JavaDoc name,
47                                       Field[] anc)
48         throws MedorException;
49
50     /**
51      * Gives the the fields which will be used to define groups.
52      * Typically, this corresponds to the "group by" clause of SQL.
53      * Other fields can be used to construct a TupleCollection, containing
54      * all values of such fields for a given group.
55      * @return an array of field giving the grouping fields.
56      */

57     QueryTreeField[] getNestingFields();
58     
59     QueryTreeField getNestingField(String JavaDoc fieldName);
60
61     QueryTreeField replaceNestingField(QueryTreeField old, QueryTreeField neo);
62     
63     /**
64      * Gives the new NestedField
65      */

66     NestedField getNestedField();
67 }
68
Popular Tags