Created
April 7, 2021 15:10
-
-
Save nemrosim/10b31d2937b949a0dfbf6bffbe0c72b4 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() { | |
UserServiceImpl service = new UserServiceImpl(); | |
service.setRepository(getUserRepository()); | |
return service; | |
} | |
@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