com.amazon.carbonado
Annotation Type Alias


@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface Alias

Identifies alternate names for a Storable or a Storable property. An alias is used only by a repository to link to entities. Without an alias, the repository will perform a best guess at finding an entity to use. Aliases may be ignored by repositories that don't require explicitly named entities.

The most common use for an alias is for a JDBC repository, to link a storable to a table and its properties to the corresponding columns. Naming conventions for databases rarely work well for class and variable names.

Example:

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

     ...
 }
 

Author:
Brian S O'Neill
See Also:
Name

Required Element Summary
 String[] value
          Alias values for the storage layer to select from.
 

Element Detail

value

public abstract String[] value
Alias values for the storage layer to select from. It will choose the first one in the list that matches one of its own entities.



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