org.hibernate.test.annotations.query
Class QueryAndSQLTest

java.lang.Object
  extended by org.hibernate.testing.junit4.BaseUnitTestCase
      extended by org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
          extended by org.hibernate.test.annotations.query.QueryAndSQLTest

public class QueryAndSQLTest
extends BaseCoreFunctionalTestCase

Test named queries


Nested Class Summary
 
Nested classes/interfaces inherited from class org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
BaseCoreFunctionalTestCase.RollbackWork
 
Field Summary
 
Fields inherited from class org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
DIALECT, NO_CLASSES, NO_MAPPINGS, USE_NEW_METADATA_MAPPINGS, VALIDATE_DATA_CLEANUP
 
Constructor Summary
QueryAndSQLTest()
           
 
Method Summary
protected  void configure(Configuration cfg)
           
protected  Class[] getAnnotatedClasses()
           
protected  String[] getAnnotatedPackages()
           
protected  String[] getXmlFiles()
           
 void testCache()
           
 void testClassQueries()
           
 void testCollectionSQLOverriding()
           
 void testDiscriminator()
           
 void testEntitySQLOverriding()
           
 void testImplicitNativeQuery()
           
 void testImportQueryFromMappedSuperclass()
          We are testing 2 things here: 1.
 void testNativeQueryAndCompositePKAndComponents()
           
 void testNativeQueryWithFormulaAttribute()
           
 void testNativeQueryWithFormulaAttributeWithoutAlias()
           
 void testPackageQueries()
           
 void testSQLQuery()
           
 void testSQLQueryWithManyToOne()
           
 
Methods inherited from class org.hibernate.testing.junit4.BaseCoreFunctionalTestCase
addMappings, addMappings, afterConfigurationBuilt, afterConfigurationBuilt, afterSessionFactoryBuilt, afterTest, applyCacheSettings, assertAllDataRemoved, beforeTest, buildConfiguration, buildServiceRegistry, cleanupCache, cleanupTest, configuration, constructConfiguration, createSchema, generateBootstrapRegistry, getBaseForMappings, getCacheConcurrencyStrategy, getDialect, getMappings, onFailure, openSession, openSession, overrideCacheStrategy, prepareBasicRegistryBuilder, prepareBootstrapRegistryBuilder, prepareTest, readCommittedIsolationMaintained, rebuildSessionFactory, rebuildSessionFactoryOnError, serviceRegistry, sessionFactory
 
Methods inherited from class org.hibernate.testing.junit4.BaseUnitTestCase
releaseTransactions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryAndSQLTest

public QueryAndSQLTest()
Method Detail

testNativeQueryWithFormulaAttribute

public void testNativeQueryWithFormulaAttribute()

testNativeQueryWithFormulaAttributeWithoutAlias

public void testNativeQueryWithFormulaAttributeWithoutAlias()

testPackageQueries

public void testPackageQueries()
                        throws Exception
Throws:
Exception

testClassQueries

public void testClassQueries()
                      throws Exception
Throws:
Exception

testSQLQuery

public void testSQLQuery()

testImportQueryFromMappedSuperclass

public void testImportQueryFromMappedSuperclass()
We are testing 2 things here: 1. The query 'night.olderThan' is defined in a MappedSuperClass - Darkness. We are verifying that queries defined in a MappedSuperClass are processed. 2. There are 2 Entity classes that extend from Darkness - Night and Twilight. We are verifying that this does not cause any issues.eg. Double processing of the MappedSuperClass


testSQLQueryWithManyToOne

public void testSQLQueryWithManyToOne()

testImplicitNativeQuery

public void testImplicitNativeQuery()
                             throws Exception
Throws:
Exception

testNativeQueryAndCompositePKAndComponents

public void testNativeQueryAndCompositePKAndComponents()
                                                throws Exception
Throws:
Exception

testDiscriminator

public void testDiscriminator()
                       throws Exception
Throws:
Exception

testCache

public void testCache()
               throws Exception
Throws:
Exception

testEntitySQLOverriding

public void testEntitySQLOverriding()

testCollectionSQLOverriding

public void testCollectionSQLOverriding()

getAnnotatedClasses

protected Class[] getAnnotatedClasses()
Overrides:
getAnnotatedClasses in class BaseCoreFunctionalTestCase

getAnnotatedPackages

protected String[] getAnnotatedPackages()
Overrides:
getAnnotatedPackages in class BaseCoreFunctionalTestCase

getXmlFiles

protected String[] getXmlFiles()
Overrides:
getXmlFiles in class BaseCoreFunctionalTestCase

configure

protected void configure(Configuration cfg)
Overrides:
configure in class BaseCoreFunctionalTestCase


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.