java - Spring Data Mongo Null Query -


i have basic query in dao:

        query query = new query(criteria.where("userid").is(userid));         program userprogram = mongotemplate.findone(query, program.class); 

i have basic pojo gets , sets class document annotation...very basic.

in example how coalesce , return default user object if there no user? there best practice (aka nullpointer exception checking in service?)


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -