androidx.room.ColumnInfo Java Examples

The following examples show how to use androidx.room.ColumnInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TableInfo.java    From FairEmail with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Implements https://www.sqlite.org/datatype3.html section 3.1
 *
 * @param type The type that was given to the sqlite
 * @return The normalized type which is one of the 5 known affinities
 */
@ColumnInfo.SQLiteTypeAffinity
private static int findAffinity(@Nullable String type) {
    if (type == null) {
        return ColumnInfo.BLOB;
    }
    String uppercaseType = type.toUpperCase(Locale.US);
    if (uppercaseType.contains("INT")) {
        return ColumnInfo.INTEGER;
    }
    if (uppercaseType.contains("CHAR")
            || uppercaseType.contains("CLOB")
            || uppercaseType.contains("TEXT")) {
        return ColumnInfo.TEXT;
    }
    if (uppercaseType.contains("BLOB")) {
        return ColumnInfo.BLOB;
    }
    if (uppercaseType.contains("REAL")
            || uppercaseType.contains("FLOA")
            || uppercaseType.contains("DOUB")) {
        return ColumnInfo.REAL;
    }
    // sqlite returns NUMERIC here but it is like a catch all. We already
    // have UNDEFINED so it is better to use UNDEFINED for consistency.
    return ColumnInfo.UNDEFINED;
}
 
Example #2
Source File: LayerEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@Nullable
@ColumnInfo(name = "list_heading")
public abstract String getListHeading();
 
Example #3
Source File: ObservationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
/**
 * Returns a JSON object containing user responses keyed by their respective elementId in the form
 * identified by formId. Returns an empty JSON object if no responses have been provided.
 */
@CopyAnnotations
@ColumnInfo(name = "responses")
@NonNull
public abstract ResponseMap getResponses();
 
Example #4
Source File: LayerEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@PrimaryKey
@ColumnInfo(name = "id")
public abstract String getId();
 
Example #5
Source File: ProjectEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@PrimaryKey
@ColumnInfo(name = "id")
public abstract String getId();
 
Example #6
Source File: MultipleChoiceEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@PrimaryKey
@NonNull
@ColumnInfo(name = "field_id")
public abstract String getFieldId();
 
Example #7
Source File: MultipleChoiceEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "type")
public abstract MultipleChoiceEntityType getType();
 
Example #8
Source File: ProjectEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@Nullable
@ColumnInfo(name = "title")
public abstract String getTitle();
 
Example #9
Source File: LayerEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@ColumnInfo(name = "default_style")
public abstract Style getDefaultStyle();
 
Example #10
Source File: LayerEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@Nullable
@ColumnInfo(name = "project_id")
public abstract String getProjectId();
 
Example #11
Source File: Coordinates.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@ColumnInfo(name = "lat")
public abstract double getLatitude();
 
Example #12
Source File: Coordinates.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@ColumnInfo(name = "lng")
public abstract double getLongitude();
 
Example #13
Source File: UserDetails.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "id")
public abstract String getId();
 
Example #14
Source File: UserDetails.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "email")
public abstract String getEmail();
 
Example #15
Source File: UserDetails.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "display_name")
public abstract String getDisplayName();
 
Example #16
Source File: LayerEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@Nullable
@ColumnInfo(name = "item_label")
public abstract String getItemLabel();
 
Example #17
Source File: ObservationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@ColumnInfo(name = "state")
@NonNull
public abstract EntityState getState();
 
Example #18
Source File: ObservationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
/** Returns the id of the form to which this observation's responses apply. */
@CopyAnnotations
@ColumnInfo(name = "form_id")
@NonNull
public abstract String getFormId();
 
Example #19
Source File: ObservationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
/** Returns the id of the feature to which this observation applies. */
@CopyAnnotations
@ColumnInfo(name = "feature_id")
@NonNull
public abstract String getFeatureId();
 
Example #20
Source File: ObservationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@PrimaryKey
@ColumnInfo(name = "id")
@NonNull
public abstract String getId();
 
Example #21
Source File: ObservationMutationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "observation_id")
public abstract String getObservationId();
 
Example #22
Source File: ObservationMutationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "feature_type_id")
public abstract String getFeatureTypeId();
 
Example #23
Source File: ObservationMutationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "feature_id")
public abstract String getFeatureId();
 
Example #24
Source File: ObservationMutationEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "form_id")
public abstract String getFormId();
 
Example #25
Source File: UserEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "display_name")
public abstract String getDisplayName();
 
Example #26
Source File: UserEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "email")
public abstract String getEmail();
 
Example #27
Source File: UserEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@PrimaryKey
@ColumnInfo(name = "id")
public abstract String getId();
 
Example #28
Source File: FormEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@ColumnInfo(name = "layer_id")
public abstract String getLayerId();
 
Example #29
Source File: FormEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@Nullable
@ColumnInfo(name = "title")
public abstract String getTitle();
 
Example #30
Source File: FormEntity.java    From ground-android with Apache License 2.0 4 votes vote down vote up
@CopyAnnotations
@NonNull
@PrimaryKey
@ColumnInfo(name = "id")
public abstract String getId();