package com.printhub.printhub.repository.configuration;

import com.printhub.printhub.entity.configuration.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {
    @EntityGraph(attributePaths = { "roles", "roles.permissions", "roles.permissions.module" })
    Optional<User> findByUsername(String username);
}
