01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.database.platform;
18:
19: import org.apache.ojb.broker.PersistenceBroker;
20:
21: /**
22: * Interface that abstracts database dependent sql from core
23: *
24: * TODO Had to move this down into embedded source because of the OJB dependencies. This probably will
25: * go away once we get rid of the embedded plugin.
26: *
27: * @author arh14 at cornell dot edu
28: */
29: public interface Platform {
30: public static class DocSearchResult {
31: protected String sql;
32: protected int searchableAttributeCount;
33:
34: public DocSearchResult(String sql, int count) {
35: this .sql = sql;
36: this .searchableAttributeCount = count;
37: }
38:
39: public String getSql() {
40: return sql;
41: }
42:
43: public int getSearchableAttributeCount() {
44: return searchableAttributeCount;
45: }
46: }
47:
48: /**
49: * Supplies a parameterized sequence incrementation query
50: * @param sequenceName name of the sequence to be incremented
51: * @return paramaterized sequence incrementation query
52: */
53: Long getNextValSQL(String sequenceName,
54: PersistenceBroker persistenceBroker);
55:
56: /**
57: * Generates the query used to select route header rows for update
58: * @param routeHeaderId id of the routeHeader to select for update
59: * @param wait whether to block until lock is released
60: * @return the query used to select route header rows for update
61: */
62: String getLockRouteHeaderQuerySQL(Long routeHeaderId, boolean wait);
63:
64: /**
65: * Supplies the sql for a given date string that will satisfy a where clause
66: * @param date in YYYY/MM/DD format
67: * @param time in hh:mm:ss format
68: * @return the sql for a given date string that will satisfy a where clause
69: * @see SqlUtil#establishDateString(String, String, String, StringBuffer, Platform)
70: * @see SqlUtil#formatDate(String)
71: * TODO: refactor to use a parsed Date object or milliseconds instead of date String
72: */
73: String getDateSQL(String date, String time);
74:
75: }
|