LPS-38960 fix and optimization. ??PersistenceImpl.fetchBy??_Last(..) should return null rightaway, if the countBy??(..) returns 0
LPS-38960 generate