UnitOfWork uow = domainModule.newUnitOfWork();
EntityBuilder<PretextEntity> builder = uow.newEntityBuilder( PretextEntity.class );
PretextEntity pretext = builder.instance();
pretext.reason().set( "Testing purpose" );
builder.newInstance();
uow.complete();
uow = domainModule.newUnitOfWork();
QueryBuilder<PretextEntity> queryBuilder = domainModule.newQueryBuilder( PretextEntity.class );
queryBuilder = queryBuilder.where( eq( templateFor( PretextEntity.class ).reason(), "Testing purpose" ) );
Query<PretextEntity> query = uow.newQuery( queryBuilder );