Skip to content

Instantly share code, notes, and snippets.

@CristianoPassos
Last active November 27, 2018 15:43
Show Gist options
  • Save CristianoPassos/00162da90aaf1ccde3750257cc111ed0 to your computer and use it in GitHub Desktop.
Save CristianoPassos/00162da90aaf1ccde3750257cc111ed0 to your computer and use it in GitHub Desktop.
@Service
public class UserManagementService {
@Autowired
private UserService userService;
public void processUser(User user) {
userService.processAndSave(user);
}
}
@Service
public class UserService {
//Methods, Fields
public void processAndSave(User user) {
//Do something
saveUser(user);
}
@Transactional
public void saveUser(User user) {
//Saving user here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment