Package org.fastnate.generator.test.ids
Class RelativeIdsTest
java.lang.Object
org.fastnate.generator.test.AbstractEntitySqlGeneratorTest
org.fastnate.generator.test.ids.IdsTest
org.fastnate.generator.test.ids.RelativeIdsTest
Tests that relative ids of entities are written correctly.
- Author:
- Tobias Liefke
-
Field Summary
Fields inherited from class org.fastnate.generator.test.AbstractEntitySqlGeneratorTest
WRITER_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertiesConfigure our generator to use relative IDs.protected <E extends IdTestEntity<E>>
ETests to write entities of the given class.Methods inherited from class org.fastnate.generator.test.ids.IdsTest
testEmptyEntity, testFixedId, testIdentityGenerator, testPrimitiveIds, testSequenceGenerator, testTableGeneratorMethods inherited from class org.fastnate.generator.test.AbstractEntitySqlGeneratorTest
createQuery, executeSql, findResults, findResults, findSingleResult, findSingleResult, getConnection, getEm, getGenerator, setup, setup, tearDown, write
-
Constructor Details
-
RelativeIdsTest
public RelativeIdsTest()
-
-
Method Details
-
getGeneratorProperties
Configure our generator to use relative IDs.- Overrides:
getGeneratorPropertiesin classAbstractEntitySqlGeneratorTest- Returns:
- the test specific properties for the generator
-
testIds
protected <E extends IdTestEntity<E>> E testIds(Class<E> entityClass, String prefix) throws IOException, ReflectiveOperationException, SQLException Description copied from class:IdsTestTests to write entities of the given class.- Overrides:
testIdsin classIdsTest- Parameters:
entityClass- the type of the entityprefix- an option Prefix for the entity names to allow more than one call of this method- Returns:
- the first written entity as read by Hibernate
- Throws:
IOException- if the generator throws oneReflectiveOperationException- if we can't create one of the entitiesSQLException- if there is a problem with some SQL
-