= ApplicationUserRepositoryAbstract
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

== API

[source,java]
.ApplicationUserRepositoryAbstract.java
----
class ApplicationUserRepositoryAbstract<U> {
  ApplicationUser newApplicationUser()
  ApplicationUser findOrCreateUserByUsername(String username)     // <.>
  Optional<ApplicationUser> findByUsernameCached(String username)
  Optional<ApplicationUser> findByUsername(String username)
  Optional<ApplicationUser> findByEmailAddressCached(String emailAddress)
  Optional<ApplicationUser> findByEmailAddress(String emailAddress)
  Collection<ApplicationUser> find(String _search)
  Collection<ApplicationUser> findByAtPath(String atPath)
  Collection<ApplicationUser> findByRole(ApplicationRole role)
  Collection<ApplicationUser> findByTenancy(ApplicationTenancy genericTenancy)
  Collection<ApplicationUser> allUsers()
  Collection<ApplicationUser> findMatching(String search)
  void enable(ApplicationUser user)
  void disable(ApplicationUser user)
  boolean isAdminUser(ApplicationUser user)
  ApplicationUser newUser(String username, AccountType accountType, Consumer<ApplicationUser> beforePersist)
  boolean updatePassword(ApplicationUser user, String password)
  boolean isPasswordFeatureEnabled(ApplicationUser user)
}
----

<.> xref:#findOrCreateUserByUsername_String[findOrCreateUserByUsername(String)]
+
--
Uses the xref:refguide:applib:index/services/queryresultscache/QueryResultsCache.adoc[QueryResultsCache] in order to support multiple lookups from `org.apache.causeway.extensions.secman.jdo.app.user.UserPermissionViewModel` .
--

== Members

[#findOrCreateUserByUsername_String]
=== findOrCreateUserByUsername(String)

Uses the xref:refguide:applib:index/services/queryresultscache/QueryResultsCache.adoc[QueryResultsCache] in order to support multiple lookups from `org.apache.causeway.extensions.secman.jdo.app.user.UserPermissionViewModel` .

If the user does not exist, it will be automatically created.
