use of org.nextprot.api.user.service.UserService in project nextprot-api by calipho-sib.
the class PopulateRDBMSWithProteinListsApp method main.
public static void main(String[] args) {
System.setProperty("spring.profiles.active", "pro");
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:spring/core-context.xml");
UserProteinListService userProteinListService = ctx.getBean(UserProteinListService.class);
UserService userService = ctx.getBean(UserService.class);
String username = "ddtxra@gmail.com";
for (int i = 0; i < 10; i++) {
UserProteinList pl = new UserProteinList();
pl.setName("some name" + i);
pl.setDescription("some description" + i);
pl.setEntriesCount(5);
pl.setOwner(username);
pl.setOwnerId(userService.getUser(username).getId());
userProteinListService.createUserProteinList(pl);
}
ctx.close();
}
Aggregations