private Account create(final Account account,
                           final String password,
                           final boolean ignoreDuplicate) {
        final String passwordHash = hashPassword(password);
        final AccountRecord record = ACCOUNT_TO_RECORD_MAPPER.apply(
                account, ACCOUNT.newRecord());
        record.setPasswordHash(passwordHash);
        final AccountRecord accountRecord = ignoreDuplicate
                ? JooqUtil.tryCreate(identityDbConnProvider, record, ACCOUNT.USER_ID)
                : JooqUtil.create(identityDbConnProvider, record);
        return RECORD_TO_ACCOUNT_MAPPER.apply(accountRecord);
    }
Create a derived field that represents the account state.
stroom-security/stroom-security-identity-db/src/main/java/stroom/security/identity/db/AccountDaoImpl.java