This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Article { | |
private int articleId; | |
private String title; | |
private String content; | |
public Article(String title, String content) { | |
this.title = title; | |
this.content = content; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
... | |
// Room components | |
implementation "androidx.room:room-runtime:2.2.5" | |
annotationProcessor "androidx.room:room-compiler:2.2.5" | |
androidTestImplementation "androidx.room:room-testing:2.2.5" | |
// Lifecycle components | |
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.lifecycle.LiveData; | |
import androidx.room.Dao; | |
import androidx.room.Insert; | |
import androidx.room.OnConflictStrategy; | |
import androidx.room.Query; | |
import java.util.List; | |
@Dao | |
interface ArticleDao { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define database class which takes {@code Article} as table schema. | |
@Database(entities = Article.class, version = 1, exportSchema = false) | |
abstract class ArticleRoomDatabase extends RoomDatabase { | |
// APIs for accessing table data. | |
public abstract ArticleDao articleDao(); | |
private static volatile ArticleRoomDatabase SINGLETON; | |
private static final int NUMBER_OF_THREADS = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
components: | |
comp-convert-experiment-spec-to-str: | |
executorLabel: exec-convert-experiment-spec-to-str | |
inputDefinitions: | |
parameters: | |
experiment_spec_json: | |
parameterType: STRUCT | |
outputDefinitions: | |
parameters: | |
experiment_spec_str_output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
components: | |
comp-args-generator: | |
executorLabel: exec-args-generator | |
outputDefinitions: | |
parameters: | |
Output: | |
parameterType: LIST | |
comp-for-loop-1: | |
dag: | |
tasks: |