title: Android Room: DAOs with nested DAOs
body: <p>Is there a way to add DAOs as dependencies in other DAOs with Android Room Persistence Library, maybe by using Dagger2? I'm trying to avoid method explosion in a DAO class that does operations on multiple tables using transactions.</p>
  
  <p>This is what I'm trying to accomplish.</p>
  
  <p>Example: FooBarRepository.class</p>
  
  <pre><code>@Dao
  public abstract class FooBarRepository {
      // THESE ARE DAOs ADDED AS DEPENDENCIES
      FooRepository fooRepository;
      BarRepository barRepository;
  
      ...
  
      @Transaction
      public void insertOrUpdateInTransaction(FooBar... foobars) {
          for (FooBar item : foobars) {
              fooRepository.insertOrUpdateInTransaction(item.getFoo());
              barRepository.insertOrUpdateInTransaction(item.getBar());
          }
      }
  }
  </code></pre>