FileDocCategorySizeDatePackage
JPAQLComplianceTest.javaAPI DocHibernate 3.2.51578Tue Dec 12 16:22:26 GMT 2006org.hibernate.test.jpa.ql

JPAQLComplianceTest

public class JPAQLComplianceTest extends org.hibernate.test.jpa.AbstractJPATest
Tests for various JPAQL compliance issues
author
Steve Ebersole

Fields Summary
Constructors Summary
public JPAQLComplianceTest(String name)

		super( name );
	
Methods Summary
public static junit.framework.Testsuite()

		return new FunctionalTestClassTestSuite( JPAQLComplianceTest.class );
	
public voidtestAliasNameSameAsUnqualifiedEntityName()

		Session s = openSession();
		s.beginTransaction();
		s.createQuery( "select item from Item item" ).list();
		s.createQuery( "select item from Item item where item.name = 'a'" ).list();
		s.getTransaction().commit();
		s.close();
	
public voidtestGeneratedSubquery()

		Session s = openSession();
		s.createQuery( "select c FROM Item c WHERE c.parts IS EMPTY" ).list();
		s.close();
	
public voidtestIdentifierCaseSensitive()

		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" );

		s.createQuery( "select object(I) from Item i").list();
		s.close();