Created
April 7, 2021 17:12
-
-
Save nemrosim/e3b614c5421a835d4e57087b05dcd4a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nemrosim; | |
import com.nemrosim.repositories.HibernateUserRepositoryImpl; | |
import com.nemrosim.repositories.UserRepository; | |
import com.nemrosim.services.UserService; | |
import com.nemrosim.services.UserServiceImpl; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
@Configuration | |
public class AppConfiguration { | |
@Bean(name = "userService") | |
public UserService getUserService() { | |
return new UserServiceImpl(getUserRepository()); | |
} | |
@Bean(name = "userRepository") | |
public UserRepository getUserRepository() { | |
return new HibernateUserRepositoryImpl(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment