use of io.vertigo.dynamo.search.data.domain.ItemDataBase in project vertigo by KleeGroup.
the class AbstractSearchManagerTest method init.
/**
* Initialise l'index.
* @param indexName Nom de l'index
*/
protected final void init(final String indexName) {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
// On construit la BDD des voitures
itemDataBase = new ItemDataBase();
final ItemSearchLoader itemSearchLoader = getApp().getComponentSpace().resolve(ItemSearchLoader.class);
itemSearchLoader.bindDataBase(itemDataBase);
manufacturerFacetDefinition = definitionSpace.resolve("FCT_MANUFACTURER_ITEM", FacetDefinition.class);
yearFacetDefinition = definitionSpace.resolve("FCT_YEAR_ITEM", FacetDefinition.class);
itemIndexDefinition = definitionSpace.resolve(indexName, SearchIndexDefinition.class);
itemFacetQueryDefinition = definitionSpace.resolve("QRY_ITEM_FACET", FacetedQueryDefinition.class);
itemFacetMultiQueryDefinition = definitionSpace.resolve("QRY_ITEM_FACET_MULTI", FacetedQueryDefinition.class);
clean(itemIndexDefinition);
}
use of io.vertigo.dynamo.search.data.domain.ItemDataBase in project vertigo by KleeGroup.
the class SearchManagerStoreTest method doSetUp.
@Override
protected void doSetUp() throws Exception {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
itemIndexDefinition = definitionSpace.resolve(IDX_ITEM, SearchIndexDefinition.class);
// A chaque test on recrée la table famille
try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
final SqlConnection connection = dataBaseManager.getConnectionProvider(SqlDataBaseManager.MAIN_CONNECTION_PROVIDER_NAME).obtainConnection();
execCallableStatement(connection, "create table item(ID BIGINT, MANUFACTURER varchar(50), MODEL varchar(255), DESCRIPTION varchar(512), YEAR INT, KILO INT, PRICE INT, CONSOMMATION NUMERIC(8,2), MOTOR_TYPE varchar(50), OPTIONAL_NUMBER BIGINT, OPTIONAL_STRING varchar(50), LAST_MODIFIED timestamp );");
execCallableStatement(connection, "create sequence SEQ_ITEM start with 10001 increment by 1");
}
// On supprime tout
remove("*:*");
final ItemDataBase itemDataBase = new ItemDataBase();
initialDbItemSize = itemDataBase.size();
try (VTransactionWritable transaction = transactionManager.createCurrentTransaction()) {
for (final Item item : itemDataBase.getAllItems()) {
item.setId(null);
storeManager.getDataStore().create(item);
}
transaction.commit();
}
waitIndexation();
}
Aggregations