001// 002// Name 003// $RCSfile: Key.java,v $ 004// 005// Copyright 006// Confidential Property of Kabira Technologies, Inc. 007// Copyright 2009 by Kabira Technologies, Inc. 008// All rights reserved. 009// 010// History 011// $Revision: 1.1.2.1 $ $Date: 2009/08/18 00:14:10 $ 012// 013package com.kabira.platform.annotation; 014 015import java.lang.annotation.*; 016 017/** This annotation defines a single key for a Managed class. 018 */ 019@Documented 020@Inherited 021@Retention(RetentionPolicy.RUNTIME) 022@Target(ElementType.TYPE) 023public @interface Key 024{ 025 /** The name of this key on the given type. Key names must be unique 026 * for a single type (including inherited keys). 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 */ 033 String[] fields(); 034 035 /** If true, the runtime will enforce that only one instance will contain 036 * the key data. 037 */ 038 boolean unique() default true; 039 040 /** If true, the key data will be managed as an ordered set. 041 */ 042 boolean ordered() default false; 043}