Skip to content

Instantly share code, notes, and snippets.

@Alexander--
Created October 1, 2015 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alexander--/80d263643d936f88ae4f to your computer and use it in GitHub Desktop.
Save Alexander--/80d263643d936f88ae4f to your computer and use it in GitHub Desktop.
asdbfg
@Schema(className = "ExampleSchema", dbName = "example.db", dbVersion = 1)
@Provider(authority = ExampleContract.AUTHORITY, schemaClass = "ExampleSchema", name = "ExampleProviderProto")
public interface ExampleContract {
String AUTHORITY = "com.example.provider";
@Table(Developments.TABLE_NAME)
interface Developments {
String TABLE_NAME = "developments";
@URI(altNotify = {NearbyView.CONTENT_URI, DevelopmentView.CONTENT_URI})
String CONTENT_URI = "dev_table";
@PrimaryKey
@Column(type = Column.Type.INTEGER)
String ID = BaseColumns._ID;
@Column(type = Column.Type.TEXT)
String ADDRESS = "address";
@NotNull
@Column(type = Column.Type.TEXT)
String NAME = "dev_name";
@NotNull
@Column(type = Column.Type.BLOB)
String SHAPE = "shape";
@Column(type = Column.Type.INTEGER)
String STATUS = "status";
@Column(type = Column.Type.REAL)
String LATITUDE = "center_lat";
@Column(type = Column.Type.REAL)
String LONGITUDE = "center_lon";
@Column(type = Column.Type.TEXT)
String DEVELOPER = "developer";
@Column(type = Column.Type.TEXT)
String IMAGE = "pic_uri";
@Column(type = Column.Type.TEXT)
String ARCHITECT = "architect";
@Column(type = Column.Type.INTEGER)
String COMPLETION_YEAR = "end_year";
@Column(type = Column.Type.TEXT)
String COMPLETION_EXACT = "end_exact";
@Column(type = Column.Type.BLOB)
String BUILDING_DETAILS = "details";
}
@Table(Locations.TABLE_NAME)
interface Locations {
String TABLE_NAME = "locations";
@URI(altNotify = {NearbyView.CONTENT_URI, DevelopmentView.CONTENT_URI})
String CONTENT_URI = "location_table";
@PrimaryKey
@Column(type = Column.Type.INTEGER)
String ID = BaseColumns._ID;
@Column(type = Column.Type.REAL)
String COSLAT = "coslat";
@Column(type = Column.Type.REAL)
String SINLAT = "sinlat";
@Column(type = Column.Type.REAL)
String COSLNG = "coslng";
@Column(type = Column.Type.REAL)
String SINLNG = "sinlng";
String DISTANCE = "distance";
}
@Table(LocalInfo.TABLE_NAME)
@PrimaryKey(columns = {LocalInfo.ID, LocalInfo.FAVORITE_ID})
interface LocalInfo {
String TABLE_NAME = "local";
@URI(altNotify = {NearbyView.CONTENT_URI, DevelopmentView.CONTENT_URI})
String CONTENT_URI = "local";
@Unique
@Column(type = Column.Type.INTEGER)
String ID = BaseColumns._ID;
@Unique
@Column(type = Column.Type.INTEGER)
String FAVORITE_ID = "fav_id";
@NotNull
@Column(type = Column.Type.INTEGER)
String FAVOURITE = "is_favourite";
@NotNull
@Column(type = Column.Type.REAL)
String LATITUDE = "object_lat";
@NotNull
@Column(type = Column.Type.REAL)
String LONGITUDE = "object_lon";
@Column(type = Column.Type.TEXT)
String USER_NOTES = "unsent_notes";
@Column(type = Column.Type.TEXT)
String DIRTY = "modified_columns";
}
@Table(ClientInfo.TABLE_NAME)
interface ClientInfo {
String TABLE_NAME = "client_info";
@PrimaryKey
@Column(type = Column.Type.INTEGER)
String ID = "_id";
@Column(type = Column.Type.INTEGER)
String LAST_VIEWED = "last_access";
}
@SimpleView(NearbyView.VIEW_NAME)
interface NearbyView {
String VIEW_NAME = "nearby_view";
@URI(type = URI.Type.DIR, onlyQuery = true)
String CONTENT_URI = "nearest";
@From(Locations.TABLE_NAME)
String TABLE_LOCATION = Locations.TABLE_NAME;
@Join(joinTable = Developments.TABLE_NAME, joinColumn = Developments.ID, onTableAlias = TABLE_LOCATION, onColumn = Locations.ID)
String TABLE_DEVELOPMENT = Developments.TABLE_NAME;
}
@SimpleView(DevelopmentView.VIEW_NAME)
interface DevelopmentView {
String VIEW_NAME = "merged";
@URI(onlyQuery = true)
String CONTENT_URI = "developments_merged";
@From(LocalInfo.TABLE_NAME)
String TABLE_LOCAL_INFO = "local_info";
@Join(joinTable = NearbyView.VIEW_NAME, joinColumn = "ExampleSchema2.NearbyView2.developments.ID", onTableAlias = TABLE_LOCAL_INFO, onColumn = "ExampleSchema2.DevelopmentView2.LocalInfo.ID")
String TABLE_NEARBY_VIEW = NearbyView.VIEW_NAME;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment