// Path: core/src/main/java/com/contentful/vault/Sql.java
// static final String TABLE_ASSETS = "assets";
// 
// Path: core/src/main/java/com/contentful/vault/Sql.java
// static String escape(String name) {
//   return String.format("`%s`", name);
// }
// 
// Path: core/src/main/java/com/contentful/vault/Sql.java
// static String localizeName(String name, String locale) {
//   return String.format("%s$%s", name, locale);
// }


import android.database.Cursor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static android.text.TextUtils.join;
import static com.contentful.vault.Sql.TABLE_ASSETS;
import static com.contentful.vault.Sql.escape;
import static com.contentful.vault.Sql.localizeName;
  }

  private Map<String, Resource> cacheForType(Class<T> type) {
    if (type == Asset.class) {
      return assets;
    }
    return entries;
  }

  private void resolveLinks(List<T> resources, String locale) {
    LinkResolver resolver = new LinkResolver(query, assets, entries);
    for (T resource : resources) {
      resolver.resolveLinks(resource, helperForEntry(resource).getFields(), locale);
    }
  }

  private ModelHelper<?> helperForEntry(T resource) {
    SpaceHelper spaceHelper = vault.getSqliteHelper().getSpaceHelper();
    Class<?> modelType = spaceHelper.getTypes().get(resource.contentType());
    return spaceHelper.getModels().get(modelType);
  }

  private Cursor cursorFromQuery(AbsQuery<T, ?> query, String locale) {
    String[] orderArray = query.params().order();
    String order = null;
    if (orderArray != null && orderArray.length > 0) {
      order = join(", ", orderArray);
    }
    String tableName;
    if (query.type() == Asset.class) {
// Path: core/src/main/java/com/contentful/vault/Sql.java
// static final String TABLE_ASSETS = "assets";
// 
// Path: core/src/main/java/com/contentful/vault/Sql.java
// static String escape(String name) {
//   return String.format("`%s`", name);
// }
// 
// Path: core/src/main/java/com/contentful/vault/Sql.java
// static String localizeName(String name, String locale) {
//   return String.format("%s$%s", name, locale);
// }


// Path: core/src/main/java/com/contentful/vault/QueryResolver.java
import android.database.Cursor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static android.text.TextUtils.join;
import static com.contentful.vault.Sql.TABLE_ASSETS;
import static com.contentful.vault.Sql.escape;
import static com.contentful.vault.Sql.localizeName;

  }

  private Map<String, Resource> cacheForType(Class<T> type) {
    if (type == Asset.class) {
      return assets;
    }
    return entries;
  }

  private void resolveLinks(List<T> resources, String locale) {
    LinkResolver resolver = new LinkResolver(query, assets, entries);
    for (T resource : resources) {
      resolver.resolveLinks(resource, helperForEntry(resource).getFields(), locale);
    }
  }

  private ModelHelper<?> helperForEntry(T resource) {
    SpaceHelper spaceHelper = vault.getSqliteHelper().getSpaceHelper();
    Class<?> modelType = spaceHelper.getTypes().get(resource.contentType());
    return spaceHelper.getModels().get(modelType);
  }

  private Cursor cursorFromQuery(AbsQuery<T, ?> query, String locale) {
    String[] orderArray = query.params().order();
    String order = null;
    if (orderArray != null && orderArray.length > 0) {
      order = join(", ", orderArray);
    }
    String tableName;
    if (query.type() == Asset.class) {
      tableName = TABLE_ASSETS;