All Downloads are FREE. Search and download functionalities are using the official Maven repository.

backend.services.auth.UsersQueries Maven / Gradle / Ivy

There is a newer version: 1.2.3
Show newest version
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package backend.services.auth;

import backend.utils.DatabaseUtils;

/**
 *
 * @author zua
 */
public class UsersQueries {

    public static String findUser(String username, String password) {
        StringBuilder builder = new StringBuilder();
        builder.append("MATCH (u:FlexUser) WHERE u.username=");
        builder.append(DatabaseUtils.getInstance().wrapUp(username));
        if(password != null) {
            builder.append(" AND u.password=");
            builder.append(DatabaseUtils.getInstance().wrapUp(password));
            
        } else {
            builder.append(" AND u.password IS NULL");
        }
        builder.append(" RETURN u");
        String query = builder.toString();
        System.out.println("FIND_USER_QUERY = " + query);
        return query;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy