package org.realrest.domain.repository.impl;

import org.realrest.domain.City;
import org.realrest.domain.Hotel;
import org.realrest.domain.repository.CityRepository;
import org.realrest.domain.repository.HotelRepository;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

/**
 * @author volodymyr.tsukur
 */
@ApplicationScoped
public class MockedDataLoader {

    @Inject
    private HotelRepository hotelRepository;

    @Inject
    private CityRepository cityRepository;

    public void load() {
        saveCitiesAndHotels();
    }

    private void saveCitiesAndHotels() {
        final City lviv = new City();
        lviv.setName("Львов");
        cityRepository.create(lviv);

        final City kyiv = new City();
        kyiv.setName("Киев");
        cityRepository.create(kyiv);

        final Hotel vintageBoutique = new Hotel();
        vintageBoutique.setName("Винтаж Бутик Отель");
        hotelRepository.create(vintageBoutique);

        final Hotel premierPalace = new Hotel();
        premierPalace.setName("Премьер Палас");
        hotelRepository.create(premierPalace);
    }

}

@@ -666,13 +666,12 @@
 me(%22
-%D0%9B%D1%8C%D0%B2%D0%BE%D0%B2
+Lviv
 %22);%0A
@@ -772,12 +772,12 @@
 me(%22
-%D0%9A%D0%B8%D0%B5%D0%B2
+Kyiv
 %22);%0A
@@ -902,26 +902,30 @@
 me(%22
-%D0%92%D0%B8%D0%BD%D1%82%D0%B0%D0%B6 %D0%91%D1%83%D1%82%D0%B8%D0%BA %D0%9E%D1%82%D0%B5%D0%BB%D1%8C
+Vintage Bootique Hotel
 %22);%0A
@@ -1058,21 +1058,22 @@
 me(%22
-%D0%9F%D1%80%D0%B5%D0%BC%D1%8C%D0%B5%D1%80 %D0%9F%D0%B0%D0%BB%D0%B0%D1%81
+Premier Palace
 %22);%0A

Converting to latin.