Merge pull request #29 from uweschaefer/master

fix for entities that use @Entity(name=...)
Merge pull request #32 from uweschaefer/master

added test resulting in NPE when combining count&distinct.
fix NPE when combining count&distinct for pull request #32