View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
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  package org.kuali.rice.krad.data.platform.generator;
17  
18  import java.lang.annotation.Documented;
19  import java.lang.annotation.ElementType;
20  import java.lang.annotation.Inherited;
21  import java.lang.annotation.Retention;
22  import java.lang.annotation.RetentionPolicy;
23  import java.lang.annotation.Target;
24  
25  /**
26   * Annotation for mimicing auto-incrementing fields.  Currently, only one auto-
27   * incrementing field is allowed per entity, but could be modified in the future
28   * if required (just add a @Sequences annotation that help an array of @Sequence
29   * annotations). This is used in conjunction with the Kuali sequence managers rather
30   * than the standard JPA generated value annotations. The reason is that Kuali 
31   * uses a sequence like algorithm for all supported databases (mysql, oracle) 
32   * rather than identity or auto-incrementing fields.
33   * 
34   * @author Kuali Rice Team (rice.collab@kuali.org)
35   */
36  @Documented
37  @Target({ElementType.TYPE})
38  @Retention(RetentionPolicy.RUNTIME)
39  @Inherited
40  public @interface Sequence {
41  	String name();
42  	String property();
43  }