I'm learning the play framework by making a stack overflow clone. The schema is Area (eg. programming) -> Language(eg. java) -> Question -> Answer
But when I try to add a question for Java:
Language language = Language.findById(langId)
gives:
IllegalArgumentException occured : id to load is required for loading
It's not able to get the
language.id for Java. When I check my Mysql db, Java is assigned id=1. Why is it not able to get the id?
I'm guessing the controller gets the id from the url, and my url doesn't have the id for the language. Currently my routes are set as:
/Area (Eg., Programming)
/Language (Eg., Java)
/Questions (list of all questions related to Java)
If this is the case, how do I add the id of the master to the slave's url? i.e., my questions url should have id for 'Programming' (areaId=1) and for Java (languageId=1)?