Fixed code and query releated issues in collectionRepository hibernate