<commit_before>package org.intellimate.server.database.operations;

import org.intellimate.server.database.model.tables.records.UserRecord;
import org.jooq.DSLContext;
import org.jooq.Record1;

import javax.swing.text.html.Option;
import java.util.Optional;

import static org.intellimate.server.database.model.Tables.*;

/**
 * this class is concerned with the user-table
 * @author LeanderK
 * @version 1.0
 */
public class UserOperations extends AbstractOperations {
    protected UserOperations(DSLContext create) {
        super(create);
    }

    /**
     * returns the password for the email
     * @param email the email of the user
     * @return the password or empty if not existing
     */
    public Optional<String> getUserPassword(String email) {
        return create.select(USER.PASSWORD)
                .from(USER)
                .where(USER.EMAIL.eq(email))
                .fetchOptional()
                .map(Record1::value1);
    }

    /**
     * inserts the user into the database
     * @param userRecord the record to insert
     */
    public void insertUser(UserRecord userRecord) {
        create.executeInsert(userRecord);
    }
}<commit_msg>db: updated userOperations<commit_after>package org.intellimate.server.database.operations;

import org.intellimate.server.database.model.tables.records.UserRecord;
import org.jooq.DSLContext;

import java.util.Optional;

import static org.intellimate.server.database.model.Tables.*;

/**
 * this class is concerned with the user-table
 * @author LeanderK
 * @version 1.0
 */
public class UserOperations extends AbstractOperations {
    protected UserOperations(DSLContext create) {
        super(create);
    }

    /**
     * returns the user for the email
     * @param email the email of the user
     * @return the user or empty if not existing
     */
    public Optional<UserRecord> getUser(String email) {
        return create.selectFrom(USER)
                .where(USER.EMAIL.eq(email))
                .fetchOptional();
    }

    /**
     * inserts the user into the database
     * @param userRecord the record to insert
     */
    public void insertUser(UserRecord userRecord) {
        create.executeInsert(userRecord);
    }
}
{'fraction_non_alphanumeric': 0.09549549549549549, 'fraction_numerical': 0.003153153153153153, 'mean_word_length': 2.816151202749141, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3959195', 'n_tokens_mistral': 626, 'n_tokens_neox': 617, 'n_words': 162}