public class AbstractEntitySqlGeneratorTest extends Object
EntitySqlGenerator
framework.Constructor and Description |
---|
AbstractEntitySqlGeneratorTest() |
Modifier and Type | Method and Description |
---|---|
<E> List<E> |
findResults(Class<E> entityClass)
Finds all entities of the given entity class.
|
<E> List<E> |
findResults(String query,
Class<E> entityClass)
Finds all entities for the given query and entity class.
|
<E> E |
findSingleResult(Class<E> entityClass)
Finds the only entity for the given entity class.
|
<E> E |
findSingleResult(String query,
Class<E> entityClass)
Finds the entity for the given query and entity class.
|
void |
setUp()
Build a entity manager factory (with a connected database) for testing.
|
void |
tearDown()
Close the entity manager factory.
|
protected <E> void |
write(E entity)
Writes the entity with the generator.
|
public <E> List<E> findResults(Class<E> entityClass)
entityClass
- the class of the entitypublic <E> List<E> findResults(String query, Class<E> entityClass)
query
- the JPA-QL queryentityClass
- the class of the entitypublic <E> E findSingleResult(Class<E> entityClass)
entityClass
- the class of the entitypublic <E> E findSingleResult(String query, Class<E> entityClass)
query
- the JPA-QL queryentityClass
- the class of the entitypublic void setUp()
public void tearDown()
protected <E> void write(E entity) throws IOException
entity
- the entity to writeIOException
- if the generator throws oneCopyright © 2016 fastnate.org. All rights reserved.