Fix #884 : compilation error with Java8 and MongoDB

Fix UserRepository when generated with Java8 and MongoDB