001//
002// Name
003//  $RCSfile: Key.java,v $
004// 
005// Copyright
006//  Copyright 2009-2015 Cloud Software Group, Inc. ALL RIGHTS RESERVED.
007//  Cloud Software Group, Inc. Confidential Information
008//
009// History
010//  $Revision: 1.1.2.4 $ $Date: 2015/01/27 03:24:12 $
011//
012package com.kabira.platform.annotation;
013
014import java.lang.annotation.*;
015
016/** This annotation defines a single key for a Managed class.
017  */
018@Documented
019@Inherited
020@Retention(RetentionPolicy.RUNTIME)
021@Target(ElementType.TYPE)
022public @interface Key
023{
024    /** The name of this key on the given type. Key names must be unique
025      * for a single type (including inherited keys).
026      * @return String
027      */
028    String name();
029
030    /** An ordered list of the fields that make up this key. The fields
031      * must be defined in this class or in a superclass.
032      * @return String[]
033      */
034    String[] fields();
035
036    /** If true, the runtime will enforce that only one instance will contain
037      * the key data.
038      * @return boolean
039      */
040    boolean unique() default true;
041
042    /** If true, the key data will be managed as an ordered set.
043      * @return boolean
044      */
045    boolean ordered() default false;
046
047    /** If true, the key fields can be updated.
048      * @return boolean
049      * @see com.kabira.platform.KeyManager#updateIndexes(Object)
050      */
051    boolean mutable() default false;
052}