@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Automatic
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);
...
}
SequenceCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.