Skip to content

Instantly share code, notes, and snippets.

@nemrosim
Created April 7, 2021 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemrosim/e3b614c5421a835d4e57087b05dcd4a3 to your computer and use it in GitHub Desktop.
Save nemrosim/e3b614c5421a835d4e57087b05dcd4a3 to your computer and use it in GitHub Desktop.
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