updated jpa 2.0 to 2.1
several query fixes to support new model