Changed entitymanagers to use less SQL Querys and rely more on the
runtime object model.