01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.server;
12:
13: import com.versant.core.jdo.QueryDetails;
14:
15: /**
16: * A query compiled from a QueryDetails instance.
17: */
18: public interface CompiledQuery {
19:
20: /**
21: * Get the unique ID assigned to this CompiledQuery.
22: */
23: public int getId();
24:
25: /**
26: * Give this query an ID. This is used by {@link CompiledQueryCache}
27: * to assign unique IDs to CompiledQuery's.
28: */
29: public void setId(int id);
30:
31: /**
32: * Return the QueryDetails this query was compiled from. This method
33: * may return null if this information is not available.
34: */
35: public QueryDetails getQueryDetails();
36:
37: /**
38: * Return bitmapped array of the class indexes involved in this query in
39: * some way. that will cause the results
40: * of this query to be evicted when their instances are modified. Each
41: * class index has one bit in this array.
42: */
43: public int[] getEvictionClassBits();
44:
45: /**
46: * Get the indexes of all of the classes involved in some way. This is
47: * used to check query cache eviction and to trigger flushing.
48: */
49: public int[] getClassIndexes();
50:
51: /**
52: * If this is a query with a single/unique result.
53: */
54: public boolean isUnique();
55:
56: /**
57: * Is this a non default projection query.
58: * This will return false for the default projection.
59: */
60: public boolean isProjectionQuery();
61:
62: /**
63: * If this query returns default results. ie The result will be a collection
64: * of managed instances.
65: */
66: public boolean isDefaultResult();
67:
68: /**
69: * The index of the first occurance of 'this' in the projection. If not then
70: * return -1.
71: */
72: public int getFirstThisIndex();
73:
74: /**
75: * The typeCode of each column or null if this is not a projection query.
76: *
77: * @see com.versant.core.metadata.MDStatics
78: */
79: public int[] getResultTypeCodes();
80: }
|