public void bulkUpdatePricesInLocal() {
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaUpdate<ProductEntity> cu = cb.createCriteriaUpdate(ProductEntity.class);
    Root<ProductEntity> root = cu.from(ProductEntity.class);
    Join<ProductEntity, CurrencyEntity> currencyToConsumer = root.join(ProductEntity_.currencyToConsumer);
    Join<ProductEntity, CurrencyEntity> currencyToRetailer = root.join(ProductEntity_.currencyToRetailer);

    Expression<BigDecimal> prodConsumer = cb.prod(root.<BigDecimal>get(ProductEntity_.priceToConsumer), currencyToConsumer.<BigDecimal>get(CurrencyEntity_.rateTCMB));
    Expression<BigDecimal> prodRetailer = cb.prod(root.<BigDecimal>get(ProductEntity_.priceToRetailer), currencyToRetailer.<BigDecimal>get(CurrencyEntity_.rateTCMB));

    cu.set(root.get(ProductEntity_.priceToConsumerInLocal), prodConsumer);
    cu.set(root.get(ProductEntity_.priceToRetailerInLocal), prodRetailer);

    Query query = em.createQuery(cu);
    int resultList = query.executeUpdate();
}