Code example for Session

Methods: closebeginTransactioncreateQuerygetTransaction

public class JPAQLComplianceTest extends AbstractJPATest { 
	public void testAliasNameSameAsUnqualifiedEntityName() { 
		Session s = openSession();
		s.createQuery( "select item from Item item" ).list();
		s.createQuery( "select item from Item item where = 'a'" ).list();
	public void testIdentifierCaseSensitive() throws Exception {
		Session s = openSession( );
		// a control test (a user reported that the JPA 'case insensitivity' support 
		// caused problems with the "discriminator resolution" code; unable to reproduce)... 
		s.createQuery( "from MyEntity e where e.class = MySubclassEntity" );
		s.createQuery( "from MyEntity e where e.other.class = MySubclassEntity" );
		s.createQuery( "from MyEntity where other.class = MySubclassEntity" );
Connect your IDE to all the code out there  Get Codota for Java