Backport fixes to 1.3 branch: GTNPORTAL-2746 Perf improvement in HibernateIdentityStoreImpl by using HQL instead of filterByAttributeValues. New unit test