src/com/vehiclerental/dataLayer/sqliteImplementation/UserDaoSqliteImpl.java
/**
     * Search for an user whose a part of email or full name match a the search term in the SQLite database
     *
     * @param searchTerm a string of minimum 3 characters
     * @return A list of matching users
     */
Search for an user whose a part of email or full name match a the search term in the SQLite database
@param searchTerm a string of minimum 3 characters
@return A list of matching users
Search for an user whose a part of email or full name match a the search term in the SQLite database @param searchTerm a string of minimum 3 characters @return A list of matching users
@Override
    public List<User> searchUsers(String searchTerm) {
        try {
            QueryBuilder<User, Integer> statementBuilder = dao.queryBuilder();
            Where whereClause = statementBuilder.where();
            whereClause
                    .like(User.EMAIL_ADDRESS_FIELD_NAME, "%" + searchTerm + "%")
                    .like(User.FULL_NAME_FIELD_NAME, "%" + searchTerm + "%")
                .or(2)
                .eq(User.IS_STAFF_FIELD_NAME, false)
            .and(2);
            return dao.query(statementBuilder.prepare());
        } catch (SQLException e) {
            return null;
        }
    }
@ Override public List < User > searchUsers ( String searchTerm ) { try { QueryBuilder < User , Integer > statementBuilder = dao . queryBuilder ( ) ; Where whereClause = statementBuilder . where ( ) ; whereClause . like ( User . EMAIL_ADDRESS_FIELD_NAME , "%" + searchTerm + "%" ) . like ( User . FULL_NAME_FIELD_NAME , "%" + searchTerm + "%" ) . or ( 2 ) . eq ( User . IS_STAFF_FIELD_NAME , false ) . and ( 2 ) ; return dao . query ( statementBuilder . prepare ( ) ) ; } catch ( SQLException e ) { return null ; } }
Search for an user whose a part of email or full name match a the search term in the SQLite database
 @param searchTerm a string of minimum 3 characters
 @return A list of matching users
Search for an user whose a part of email or full name match a the search term in the SQLite database @param searchTerm a string of minimum 3 characters @return A list of matching users
//Search for user WHERE the email address or the full name field looks like the provided term //The users must not be staff members