// Path: app/src/main/java/com/jonathanpetitfrere/mvvm/repository/persistence/MvvmDatabase.java
// @Database(entities = {User.class}, version = 1)
// public abstract class MvvmDatabase extends RoomDatabase {
// 
//     public abstract UserDao userDao();
// 
// }
// 
// Path: app/src/main/java/com/jonathanpetitfrere/mvvm/repository/persistence/dao/UserDao.java
// @Dao
// public interface UserDao {
// 
//     @Query("SELECT * FROM user WHERE email = :email")
//     Flowable<User> loadUser(String email);
// 
//     @Insert(onConflict = OnConflictStrategy.REPLACE)
//     void saveUser(User user);
// 
//     @Query("SELECT * FROM user")
//     Flowable<List<User>> loadUsers();
// }


import android.arch.persistence.room.Room;
import android.content.Context;
import com.jonathanpetitfrere.mvvm.repository.persistence.MvvmDatabase;
import com.jonathanpetitfrere.mvvm.repository.persistence.dao.UserDao;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
package com.jonathanpetitfrere.mvvm.di;





/**
 * @author jpetit
 */

@Module
public class RepositoryModule {

    @Singleton
    @Provides
// Path: app/src/main/java/com/jonathanpetitfrere/mvvm/repository/persistence/MvvmDatabase.java
// @Database(entities = {User.class}, version = 1)
// public abstract class MvvmDatabase extends RoomDatabase {
// 
//     public abstract UserDao userDao();
// 
// }
// 
// Path: app/src/main/java/com/jonathanpetitfrere/mvvm/repository/persistence/dao/UserDao.java
// @Dao
// public interface UserDao {
// 
//     @Query("SELECT * FROM user WHERE email = :email")
//     Flowable<User> loadUser(String email);
// 
//     @Insert(onConflict = OnConflictStrategy.REPLACE)
//     void saveUser(User user);
// 
//     @Query("SELECT * FROM user")
//     Flowable<List<User>> loadUsers();
// }


// Path: app/src/main/java/com/jonathanpetitfrere/mvvm/di/RepositoryModule.java
import android.arch.persistence.room.Room;
import android.content.Context;
import com.jonathanpetitfrere.mvvm.repository.persistence.MvvmDatabase;
import com.jonathanpetitfrere.mvvm.repository.persistence.dao.UserDao;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;

package com.jonathanpetitfrere.mvvm.di;





/**
 * @author jpetit
 */

@Module
public class RepositoryModule {

    @Singleton
    @Provides
    MvvmDatabase provideMvvmDatabase(Context context) {