I am new to JPA and often while reading documentation, I see different mechanisms to create queries. One with EntityManager and the other mechanism deals with Sessions. Which is the preferred mechanism?