Fixed checking if criteria in EntityDao should be build by DQL