01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.jdbc.support.incrementer;
18:
19: import org.springframework.dao.DataAccessException;
20:
21: /**
22: * Interface that defines contract of incrementing any data store field's
23: * maximum value. Works much like a sequence number generator.
24: *
25: * <p>Typical implementations may use standard SQL, native RDBMS sequences
26: * or Stored Procedures to do the job.
27: *
28: * @author Dmitriy Kopylenko
29: * @author Jean-Pierre Pawlak
30: * @author Juergen Hoeller
31: */
32: public interface DataFieldMaxValueIncrementer {
33:
34: /**
35: * Increment the data store field's max value as int.
36: * @return int next data store value such as <b>max + 1</b>
37: * @throws org.springframework.dao.DataAccessException in case of errors
38: */
39: int nextIntValue() throws DataAccessException;
40:
41: /**
42: * Increment the data store field's max value as long.
43: * @return int next data store value such as <b>max + 1</b>
44: * @throws org.springframework.dao.DataAccessException in case of errors
45: */
46: long nextLongValue() throws DataAccessException;
47:
48: /**
49: * Increment the data store field's max value as String.
50: * @return next data store value such as <b>max + 1</b>
51: * @throws org.springframework.dao.DataAccessException in case of errors
52: */
53: String nextStringValue() throws DataAccessException;
54:
55: }
|