KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > persist > annotations > Column


1 // $Id: Column.java 12 2007-08-29 05:23:13Z jcamaia $
2

3 package net.sf.persist.annotations;
4
5 import java.lang.annotation.ElementType JavaDoc;
6 import java.lang.annotation.Retention JavaDoc;
7 import java.lang.annotation.RetentionPolicy JavaDoc;
8 import java.lang.annotation.Target JavaDoc;
9
10 /**
11  * Defines column mapping for a given field. Must be added to a getter or a
12  * setter of the field being mapped.
13  */

14 @Retention JavaDoc(RetentionPolicy.RUNTIME)
15 @Target JavaDoc(ElementType.METHOD)
16 public @interface Column {
17
18     /**
19      * Name of the column mapped to the field.
20      */

21     String JavaDoc name() default ""; // a @Column annotation can leave name undefined, since it may be only concerned with autoGenerated
22

23     /**
24      * If the field is auto-generated in the database (eg. auto increment
25      * fields). This will hint the engine to avoid using the field in
26      * insert/update automatic operations, and to let it know which fields must
27      * be updated if updateAutoGeneratedKeys is set to true.
28      */

29     boolean autoGenerated() default false;
30
31 }
32
Popular Tags