Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-drug-products into starter
  • Loading branch information
Newatia authored and Newatia committed Nov 3, 2021
2 parents 8263961 + 99c3fce commit ee57ff3
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package gov.hhs.gsrs.products.productall.indexers;

import gov.hhs.gsrs.products.productall.models.*;
import java.util.function.Consumer;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import gov.hhs.gsrs.products.productall.models.ProductIngredientAll;
import gov.hhs.gsrs.products.productall.models.ProductMainAll;
import gsrs.DefaultDataSourceConfig;
import ix.core.search.text.IndexValueMaker;
import ix.core.search.text.IndexableValue;
import ix.ginas.models.v1.Substance;
import lombok.extern.slf4j.Slf4j;

import javax.persistence.*;
import java.util.function.Consumer;

@Slf4j
public class ProductSubstanceIndexValueMaker implements IndexValueMaker<ProductMainAll> {

@PersistenceContext(unitName = DefaultDataSourceConfig.NAME_ENTITY_MANAGER)
Expand Down Expand Up @@ -50,7 +55,7 @@ public void createIndexableValues(ProductMainAll product, Consumer<IndexableValu
}

} catch (Exception e) {
e.printStackTrace();
log.warn("Error indexing product:" + product.fetchKey(), e);
}
}
}

0 comments on commit ee57ff3

Please sign in to comment.