src/com/vehiclerental/dataLayer/sqliteImplementation/OrmLiteHelper.java
/**
     * Creates the User table and generates default values
     *
     * @param dao ORMLite user data access object
     */
Creates the User table and generates default values
@param dao ORMLite user data access object
Creates the User table and generates default values @param dao ORMLite user data access object
private void initializeUserTable(Dao<User, Integer> dao) {
        try {
            TableUtils.createTable(OrmLiteConnectionSingleton.getInstance(), User.class);
            User user = new User(true, "Administrator", "admin@car-rental.co.uk", "0745983387", CryptoUtils.Sha256Hash("password"), "8 high street", "Oxford", "0X4 8HJ", "United Kingdom");
            user.encrypt();
            dao.create(user);
            user = new User(false, "Alexis Chevalier", "alexis.chevalier1@gmail.com", "0745983387", CryptoUtils.Sha256Hash("password"), "8 high street", "Oxford", "0X4 8HJ", "United Kingdom");
            user.encrypt();
            dao.create(user);
        } catch (NoSuchAlgorithmException e) {
            System.out.println("Error initializing user table");
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            System.out.println("Error initializing user table");
            e.printStackTrace();
        } catch (SQLException e) {
            System.out.println("Error initializing user table");
            e.printStackTrace();
        }
    }
private void initializeUserTable ( Dao < User , Integer > dao ) { try { TableUtils . createTable ( OrmLiteConnectionSingleton . getInstance ( ) , User . class ) ; User user = new User ( true , "Administrator" , "admin@car-rental.co.uk" , "0745983387" , CryptoUtils . Sha256Hash ( "password" ) , "8 high street" , "Oxford" , "0X4 8HJ" , "United Kingdom" ) ; user . encrypt ( ) ; dao . create ( user ) ; user = new User ( false , "Alexis Chevalier" , "alexis.chevalier1@gmail.com" , "0745983387" , CryptoUtils . Sha256Hash ( "password" ) , "8 high street" , "Oxford" , "0X4 8HJ" , "United Kingdom" ) ; user . encrypt ( ) ; dao . create ( user ) ; } catch ( NoSuchAlgorithmException e ) { System . out . println ( "Error initializing user table" ) ; e . printStackTrace ( ) ; } catch ( UnsupportedEncodingException e ) { System . out . println ( "Error initializing user table" ) ; e . printStackTrace ( ) ; } catch ( SQLException e ) { System . out . println ( "Error initializing user table" ) ; e . printStackTrace ( ) ; } }
Creates the User table and generates default values
 @param dao ORMLite user data access object
Creates the User table and generates default values @param dao ORMLite user data access object