public void generateDB() {
        em.getTransaction().begin();

//region Lists
        List<MachinistClass> mClasses = new LinkedList<>();
        List<Machinist> machinists = new LinkedList<>();
        List<Place> places = new LinkedList<>();
        List<WorkType> workTypes = new LinkedList<>();
        List<TrainType> trainTypes = new LinkedList<>();
        List<TrainInspection> trainInspectionList = new LinkedList<>();
        List<Train> trains = new LinkedList<>();
//endregion Lists

//region MClasses
        for (int i = 0; i < 3; i++) {
            MachinistClass machinistClass = new MachinistClass((float) (1 + i * 0.1), M_CLASS_NAMES[i]);
            mClasses.add(machinistClass);
            em.persist(machinistClass);
        }
//endregion MClasses

//region Machinists
        for (int i = 0; i < 10; i++) {
            Machinist machinist = new Machinist(MACHINIST_NAMES[i % MACHINIST_NAMES.length], mClasses.get(i % mClasses.size()), "" + i);
            machinists.add(machinist);
            em.persist(machinist);
        }
//endregion Machinists

//region Places
        for (String PLACES_NAME : PLACES_NAMES) {
            Place place = new Place(PLACES_NAME, "description");
            em.persist(place);
            places.add(place);
        }
//endregion Places

//region WorkTypes
        for (int i = 0; i < WORK_TYPE_NAMES.length; i++) {
            WorkType workType = new WorkType(WORK_TYPE_NAMES[i], (BASE_WORK_PAY + WORK_PAY_MUTATOR * i));
            workTypes.add(workType);
        }
//endregion WorkTypes

//region TrainTypes
        for (String TRAIN_TYPE_NAME : TRAIN_TYPE_NAMES) {
            TrainType trainType = new TrainType(TRAIN_TYPE_NAME, "description");
            em.persist(trainType);
            trainTypes.add(trainType);
        }
//endregion TrainTypes

//region TO
        for (int i = 0; i < TRAINS_COUNT; i++) {
            TrainInspection trainInspection = new TrainInspection(new Date(), "Petro", "Succeful");
            em.persist(trainInspection);
            trainInspectionList.add(trainInspection);
        }
//endregion TO

//region Trains
        for (int i = 0; i < TRAINS_COUNT; i++) {
            Train train = new Train(trainTypes.get(trainTypes.size() % TRAINS_COUNT), trainInspectionList.get(i));
            em.persist(train);
            trains.add(train);
        }
//endregion Trains

//region Works
        for (int i = 0; i < machinists.size(); i++) {
            Work work = new Work(new Date(2014, 3, 1 + (i % 2)),
                    trains.get(i % trains.size()),
                    machinists.get(i),
                    places.get(i % places.size()),
                    workTypes.get(i % workTypes.size()),
                    (i % 2 > 0)
            );

            em.persist(work);
        }
//endregion Works

        em.getTransaction().commit();
    }