|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@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);
...
}
Sequence
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||