com.amazon.carbonado
Annotation Type Nullable


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

Identifies that a Storable property can have a null value. By default, all Storable properties are required to have a non-null value. It is illegal to declare a property as nullable whose type is a primitive non-object.

Example:

 public interface UserInfo extends Storable<UserInfo> {
     @Nullable
     String getName();
     void setName(String name);

     ...
 }
 

If the repository does not allow a property to be declared as nullable because the underlying schema differs, it can be also annotated as Independent. This makes it easier for a common set of Storables to interact with schemas which are slightly different. Attempting to persist null into a property for which null is not allowed will likely result in a constraint exception.

Author:
Brian S O'Neill



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