Backport fixes to 1.3 branch: GTNPORTAL-2746 Perf improvement in Hiberna...

...teIdentityStoreImpl by using HQL instead of filterByAttributeValues. New unit test