Hullaballoonatic
11/17/2019, 8:37 PMval user = userRepository.findByIdOrNull(userId)!!
user.password = "blah"
user.save()
how could I write the User
class to have access to the UserRepository
bean?
perhaps in an ideal world, the repository could be/inside an object of the user class:
class User(...) {
object Repository : UserRepository
}
or something like that
however, objects of kotlin classes cannot have the @Component
decorator, so cannot be instantiated with beans, afaik
I think the appropriate way to go about this is to make User
a component with a prototype scope