Buggy code:
@ Controller public class TeamController { @ PreRequest public static void determineScopeRoles ( RequestData requestData ) throws Exception { } public static void determineScopeRoles ( RequestData requestData , Team team ) { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = HTTPMethod . GET_ONE ) public static Team getOneHandler ( RequestData requestData ) throws Exception { } @ RequireAuth @ Route ( method = HTTPMethod . GET ) public static JSONResponse < Collection < Team > > getAllHandler ( RequestData requestData ) throws Exception { } @ Field ( name = "name" , required = true , description = "The<seq2seq4repair_space>name<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>new<seq2seq4repair_space>team" ) @ Field ( name = "effortTrackingEnabled" , description = "Whether<seq2seq4repair_space>effort<seq2seq4repair_space>tracking<seq2seq4repair_space>is<seq2seq4repair_space>enabled<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>new<seq2seq4repair_space>team" ) @ Field ( name = "kanbanRules" , description = "The<seq2seq4repair_space>kanban<seq2seq4repair_space>rules<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>new<seq2seq4repair_space>team" , type = KanbanRules . class ) @ RequireAuth @ Route ( method = HTTPMethod . POST ) public static Team postHandler ( RequestData requestData ) throws Exception { } @ Field ( name = "name" , description = "The<seq2seq4repair_space>new<seq2seq4repair_space>name<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>team" ) @ RequireAuth ( role = ScopeRole . SCRUM_MASTER ) @ Route ( method = HTTPMethod . PUT ) public static Team putHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . SCRUM_MASTER ) @ Route ( method = HTTPMethod . DELETE ) public static void deleteHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = HTTPMethod . GET , path = "//team//{id}//project" ) public static JSONResponse < Collection < Project > > getProjectHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = HTTPMethod . GET , path = "//team//{id}//user" ) public static JSONResponse < Collection < User > > getUserHandler ( RequestData requestData ) throws Exception { Team team = EbeanEx . require ( EbeanEx . find ( Team . class , requestData . getParameter ( "id" ) ) ) ; Query < User > query = Ebean . createQuery ( User . class ) ; <START_BUG> query . where ( ) . eq ( ( "teams." + ( Team . FIELD_ID ) ) , team ) ; <END_BUG> return ResponseFactory . queryToList ( requestData , User . class , query ) ; } @ Field ( name = "user" , required = true , description = "The<seq2seq4repair_space>name<seq2seq4repair_space>or<seq2seq4repair_space>email<seq2seq4repair_space>address<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>new<seq2seq4repair_space>team<seq2seq4repair_space>member" ) @ RequireAuth ( role = ScopeRole . SCRUM_MASTER ) @ Route ( method = HTTPMethod . POST , path = "//team//{id}//user" ) public static void postMemberHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . SCRUM_MASTER ) @ Route ( method = HTTPMethod . DELETE , path = "//team//{id}//user//{userId}" ) public static void deleteMemberHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = HTTPMethod . GET , path = "//team//{id}//story" ) public static JSONResponse < Collection < Story > > getStoryHandler ( RequestData requestData ) throws Exception { } @ RequireAuth ( role = ScopeRole . TEAM_MEMBER ) @ Route ( method = HTTPMethod . GET , path = "//team//{id}//iteration" ) public static JSONResponse < Collection < Iteration > > getIterationHandler ( RequestData requestData ) throws Exception { } }

Fix:
query . where ( ) . eq ( ( "teams." + ( Team . FIELD_ID ) ) , team . getPK ( ) ) ;