01: // $Id: Column.java 12 2007-08-29 05:23:13Z jcamaia $
02:
03: package net.sf.persist.annotations;
04:
05: import java.lang.annotation.ElementType;
06: import java.lang.annotation.Retention;
07: import java.lang.annotation.RetentionPolicy;
08: import java.lang.annotation.Target;
09:
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(RetentionPolicy.RUNTIME)
15: @Target(ElementType.METHOD)
16: public @interface Column {
17:
18: /**
19: * Name of the column mapped to the field.
20: */
21: String 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: }
|