01: /*
02: $Header: /cvsroot/xorm/xorm/src/org/xorm/query/QueryLanguage.java,v 1.1 2003/04/27 00:00:25 wbiggs Exp $
03:
04: This file is part of XORM.
05:
06: XORM is free software; you can redistribute it and/or modify
07: it under the terms of the GNU General Public License as published by
08: the Free Software Foundation; either version 2 of the License, or
09: (at your option) any later version.
10:
11: XORM is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with XORM; if not, write to the Free Software
18: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20: package org.xorm.query;
21:
22: /**
23: * This small interface must be implemented by any dialect of a query
24: * language that will be used with XORM. The query can be executed
25: * by JDO by calling PersistenceManager.newQuery(QueryLanguage.LANGUAGE,
26: * this) where "this" is an instance of QueryLanguage.
27: */
28: public interface QueryLanguage extends Cloneable {
29: static final String LANGUAGE = "org.xorm.query.QueryLanguage";
30:
31: /**
32: * Gets the class of candidate instances for the query.
33: */
34: Class getCandidateClass();
35:
36: /**
37: * A hint that the implementation should undertake the work
38: * of generating the Expression object now for future use.
39: */
40: void compile() throws QuerySyntaxException;
41:
42: /**
43: * Returns the query expression generated by this object.
44: * This method may return null if compile() has not been
45: * called.
46: */
47: Expression getExpression();
48:
49: /**
50: * Gets the ordering that should be used in returning the values.
51: */
52: QueryOrdering[] getOrdering();
53: }
|