src/main/java/com/cellulant/Application.java
private void cellulantAppMultiRecordsDatabaseOperations() {
        mileageRepository.createTable();

        LOG.info("=========  BEFORE INSERTING MILEAGE DATA  ============");
        LOG.log(Level.INFO, " FOUND {0} RECORDS", mileageService.findAll().size());

        mileages = mileageService.retrieveMockMileageData();
        mileages.stream().map((mileageRealData) -> {

            LOG.log(Level.INFO, "mileage  object \n  lengthid={0}miles ={1} kilometers ={2}date_modified={3}", new Object[]{mileageRealData.getLength_id(), mileageRealData.getMiles(), mileageRealData.getKilometers(), mileageRealData.getDate_modified()});
            return mileageRealData;
        }).forEach((mileageRealData) -> {

            mileageService.save(mileageRealData);
        });
        LOG.info("=========  AFTER INSERTING MILEAGE DATA  ============");
        LOG.log(Level.INFO, " FOUND {0} RECORDS", mileageService.findAll().size());
        Date input=new Date();
        Timestamp timestamp=dateAndTimeConversionService.getTimestamp(input);
        mileageService.updateTimeStamp(timestamp);
        mileageService.findAll();
    }
/**
     * This methods creates H2 Database table , prepares data , fetches
     * kilometer data from webservice and then inserts them to the database
     * table called mileage The script is found in
     * src/main/resources/sql-scripts folder
     */
This methods creates H2 Database table , prepares data , fetches
kilometer data from webservice and then inserts them to the database
table called mileage The script is found in
src/main/resources/sql-scripts folder
This methods creates H2 Database table prepares data fetches kilometer data from webservice and then inserts them to the database table called mileage The script is found in src / main / resources / sql - scripts folder
private void cellulantAppMultiRecordsDatabaseOperations() {
        mileageRepository.createTable();
        LOG.info("=========  BEFORE INSERTING MILEAGE DATA  ============");
        LOG.log(Level.INFO, " FOUND {0} RECORDS", mileageService.findAll().size());
        mileages = mileageService.retrieveMockMileageData();
        mileages.stream().map((mileageRealData) -> {
            LOG.log(Level.INFO, "mileage  object \n  lengthid={0}miles ={1} kilometers ={2}date_modified={3}", new Object[]{mileageRealData.getLength_id(), mileageRealData.getMiles(), mileageRealData.getKilometers(), mileageRealData.getDate_modified()});
            return mileageRealData;
        }).forEach((mileageRealData) -> {
            mileageService.save(mileageRealData);
        });
        LOG.info("=========  AFTER INSERTING MILEAGE DATA  ============");
        LOG.log(Level.INFO, " FOUND {0} RECORDS", mileageService.findAll().size());
        Date input=new Date();
        Timestamp timestamp=dateAndTimeConversionService.getTimestamp(input);
        mileageService.updateTimeStamp(timestamp);
        mileageService.findAll();
    }
private void cellulantAppMultiRecordsDatabaseOperations ( ) { mileageRepository . createTable ( ) ; LOG . info ( "=========  BEFORE INSERTING MILEAGE DATA  ============" ) ; LOG . log ( Level . INFO , " FOUND {0} RECORDS" , mileageService . findAll ( ) . size ( ) ) ; mileages = mileageService . retrieveMockMileageData ( ) ; mileages . stream ( ) . map ( ( mileageRealData ) -> { LOG . log ( Level . INFO , "mileage  object \n  lengthid={0}miles ={1} kilometers ={2}date_modified={3}" , new Object [ ] { mileageRealData . getLength_id ( ) , mileageRealData . getMiles ( ) , mileageRealData . getKilometers ( ) , mileageRealData . getDate_modified ( ) } ) ; return mileageRealData ; } ) . forEach ( ( mileageRealData ) -> { mileageService . save ( mileageRealData ) ; } ) ; LOG . info ( "=========  AFTER INSERTING MILEAGE DATA  ============" ) ; LOG . log ( Level . INFO , " FOUND {0} RECORDS" , mileageService . findAll ( ) . size ( ) ) ; Date input = new Date ( ) ; Timestamp timestamp = dateAndTimeConversionService . getTimestamp ( input ) ; mileageService . updateTimeStamp ( timestamp ) ; mileageService . findAll ( ) ; }
This methods creates H2 Database table , prepares data , fetches
 kilometer data from webservice and then inserts them to the database
 table called mileage The script is found in
 src/main/resources/sql-scripts folder
This methods creates H2 Database table prepares data fetches kilometer data from webservice and then inserts them to the database table called mileage The script is found in src / main / resources / sql - scripts folder