src/com/vehiclerental/dataLayer/sqliteImplementation/OrmLiteHelper.java
/**
     * This methods sets up the database environment with the default values
     * @throws DatabaseAccessFailedException if it is not possible to connect to the database
     */
This methods sets up the database environment with the default values
@throws DatabaseAccessFailedException if it is not possible to connect to the database
This methods sets up the database environment with the default values @throws DatabaseAccessFailedException if it is not possible to connect to the database
public void ensureInitialized() throws DatabaseAccessFailedException {
        try {
            Dao<User, Integer> userDao = getOrmLiteUserDao();
            if (!userDao.isTableExists()) {
                initializeUserTable(userDao);
            }
            Dao<Branch, Integer> branchDao = getOrmLiteBranchDao();
            if (!branchDao.isTableExists()) {
                initializeBranchTable(branchDao);
            }
            Dao<Vehicle, Integer> vehicleDao = getOrmLiteVehicleDao();
            if (!vehicleDao.isTableExists()) {
                initializeVehicleTable(vehicleDao);
            }
            Dao<Booking, Integer> bookingDao = getOrmLiteBookingDao();
            if (!bookingDao.isTableExists()) {
                initializeBookingTable(bookingDao);
            }
            Dao<VehicleMove, Integer> vehicleMoveDao = getOrmLiteVehicleMoveDao();
            if (!vehicleMoveDao.isTableExists()) {
                initializeVehicleMoveTable(vehicleMoveDao);
            }
        } catch (SQLException e) {
            throw new DatabaseAccessFailedException(e.getMessage());
        }
    }
public void ensureInitialized ( ) throws DatabaseAccessFailedException { try { Dao < User , Integer > userDao = getOrmLiteUserDao ( ) ; if ( ! userDao . isTableExists ( ) ) { initializeUserTable ( userDao ) ; } Dao < Branch , Integer > branchDao = getOrmLiteBranchDao ( ) ; if ( ! branchDao . isTableExists ( ) ) { initializeBranchTable ( branchDao ) ; } Dao < Vehicle , Integer > vehicleDao = getOrmLiteVehicleDao ( ) ; if ( ! vehicleDao . isTableExists ( ) ) { initializeVehicleTable ( vehicleDao ) ; } Dao < Booking , Integer > bookingDao = getOrmLiteBookingDao ( ) ; if ( ! bookingDao . isTableExists ( ) ) { initializeBookingTable ( bookingDao ) ; } Dao < VehicleMove , Integer > vehicleMoveDao = getOrmLiteVehicleMoveDao ( ) ; if ( ! vehicleMoveDao . isTableExists ( ) ) { initializeVehicleMoveTable ( vehicleMoveDao ) ; } } catch ( SQLException e ) { throw new DatabaseAccessFailedException ( e . getMessage ( ) ) ; } }
This methods sets up the database environment with the default values
 @throws DatabaseAccessFailedException if it is not possible to connect to the database
This methods sets up the database environment with the default values @throws DatabaseAccessFailedException if it is not possible to connect to the database