com.amazon.carbonado
Annotation Type Automatic


@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Automatic

Identifies a Storable property capable of selecting its own value on insert. The actual process by which a value is automatically assigned is repository dependent. In the JDBC repository, the value might come from an auto-increment column or a database-specific trigger.

If the underlying repository doesn't automatically supply a value to an automatic property, no immediate warning is given and instead the property will be assigned a default value of null or zero. This may cause problems if the automatic property is a member of a key. Explicitly specifying a value can sometimes be used to bypass the automatic value altogether.

Example:

 @PrimaryKey("userInfoID")
 public interface UserInfo extends Storable<UserInfo> {
     @Automatic
     long getUserInfoID();
     void setUserInfoID(long id);

     ...
 }
 

Since:
1.2
Author:
Brian S O'Neill
See Also:
Sequence



Copyright © 2006-2008 Amazon Technologies, Inc.. All Rights Reserved.