01: /**********************************************************************
02: Copyright (c) 2002 Mike Martin and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15: Contributors:
16: Andy Jefferson - coding standards
17: ...
18: **********************************************************************/package org.jpox.store.exceptions;
19:
20: import org.jpox.exceptions.JPOXException;
21: import org.jpox.store.DatastoreContainerObject;
22: import org.jpox.store.DatastoreField;
23: import org.jpox.util.Localiser;
24:
25: /**
26: * A <tt>TableMismatchException</tt> is thrown if the query statement generator
27: * attempts to reference a column in a table expression but the column's table
28: * is not present in the expression, nor can it be sensibly joined to the
29: * expression.
30: * This indicates a bug in the query statement generator.
31: *
32: * @see org.jpox.store.expression.LogicSetExpression
33: * @version $Revision: 1.11 $
34: */
35: public class TableMismatchException extends JPOXException {
36: protected static final Localiser LOCALISER = Localiser
37: .getInstance("org.jpox.Localisation");
38:
39: /**
40: * Constructs a table mismatch exception.
41: *
42: * @param column The column that was being referenced.
43: * @param mainTable The main table of the table expression.
44: */
45: public TableMismatchException(DatastoreField column,
46: DatastoreContainerObject mainTable) {
47: super (LOCALISER.msg("020002", column.getIdentifier(),
48: mainTable, column.getDatastoreContainerObject()));
49: setFatal();
50: }
51: }
|