Skip to content

Instantly share code, notes, and snippets.

@nemrosim
Created April 7, 2021 15:15
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/bd43c23c3d10d8aa7cc8ba97e265e9a0 to your computer and use it in GitHub Desktop.
Save nemrosim/bd43c23c3d10d8aa7cc8ba97e265e9a0 to your computer and use it in GitHub Desktop.
package com.nemrosim;
import com.nemrosim.models.User;
import com.nemrosim.services.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class Application {
public static void main(String[] args) {
ApplicationContext context = new AnnotationConfigApplicationContext(AppConfiguration.class);
UserService service = context.getBean("userService", UserService.class);
User user = service.findAll().get(0);
System.out.println(user.getFirstName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment