Search in sources :

Example 1 with UserProteinListService

use of org.nextprot.api.user.service.UserProteinListService 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();
}
Also used : ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) UserService(org.nextprot.api.user.service.UserService) UserProteinListService(org.nextprot.api.user.service.UserProteinListService) UserProteinList(org.nextprot.api.user.domain.UserProteinList)

Aggregations

UserProteinList (org.nextprot.api.user.domain.UserProteinList)1 UserProteinListService (org.nextprot.api.user.service.UserProteinListService)1 UserService (org.nextprot.api.user.service.UserService)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1