title: How doesn't duplicate records to ormlite
body: <p>I have a one problem. My app connects with WebService and downloads data about breweries. These data are saved to OrmliteDB. </p>
  
  <p>What should I do so that database doesn't duplicate records which are the same.</p>
  
  <p><strong>window.java</strong></p>
  
  <pre><code>dbHelper = (DatabaseHelper) OpenHelperManager.getHelper(getApplication(), DatabaseHelper.class);
  
  final RuntimeExceptionDao studDao = dbHelper.getStudRuntimeExceptionDao();
  BeerDataBaseTemplate wdt = new BeerDataBaseTemplate();
  
  for (Datum i : breweries.getData()) {
      if (i.getName() != null &amp;&amp; i.getAbv() != null &amp;&amp; i.getDescription() != null &amp;&amp; i.getLabels() != null) {
            studDao.createIfNotExists(new BeerDataBaseTemplate("" + i.getName(), i.getAbv(), i.getDescription(), i.getLabels().getMedium().toString(), i.getLabels().getLarge().toString(), false));
      } else if (i.getName() != null &amp;&amp; i.getAbv() != null &amp;&amp; i.getDescription() == null &amp;&amp; i.getLabels() != null) {
           studDao.createOrUpdate(new BeerDataBaseTemplate("" + i.getName(), i.getAbv(), "Brak danych", i.getLabels().getMedium().toString(), i.getLabels().getLarge().toString(), false));
      } else if (i.getName() != null &amp;&amp; i.getAbv() != null &amp;&amp; i.getDescription() == null &amp;&amp; i.getLabels() == null) {
           studDao.createOrUpdate(new BeerDataBaseTemplate("" + i.getName(), i.getAbv(), "Brak danych", "Brak zdjęcia", "Brak zdjęcia", false));
       } else if (i.getName() != null &amp;&amp; i.getAbv() == null &amp;&amp; i.getDescription() == null &amp;&amp; i.getLabels() == null) {
           studDao.createOrUpdate(new BeerDataBaseTemplate("" + i.getName(), "Brak danych", "Brak danych", "Brak zdjęcia", "Brak zdjęcia", false));
      } else if (i.getName() == null &amp;&amp; i.getAbv() == null &amp;&amp; i.getDescription() == null &amp;&amp; i.getLabels() == null) {
          studDao.createOrUpdate(new BeerDataBaseTemplate("Brak danych", "Brak danych", "Brak danych", "Brak zdjęcia", "Brak zdjęcia", false));
      }
  }
  </code></pre>