Commit 07af99f6 authored by 覃振观's avatar 覃振观 👶

111

parent 4136e703
package com.huigou.topsun.product.application.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.topsun.config.JPAUtils;
import com.huigou.topsun.product.application.BrandApplication;
import com.huigou.topsun.product.application.ProductApplication;
import com.huigou.topsun.product.domain.*;
......@@ -12,7 +11,6 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import javax.persistence.EntityManager;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
......@@ -67,8 +65,10 @@ public class ProductApplicationImpl implements ProductApplication {
Map<String, Object> resultMap = new HashMap<>();
ProductDetail productDetail = detailRepository.findByProductIdEquals((long)productId);
resultMap.put("detai", productDetail);
EntityManager manager = JPAUtils.getEntityManger();
manager.getTransaction().begin();
// EntityManager manager = JPAUtils.getEntityManger();
// manager.getTransaction().begin();
// manager.flush();
// manager.close();
// --------------------------------- 类别查询 ---------------------------------
ArrayList<Brand> brands = (ArrayList<Brand>)brandRepository.findAll();
......@@ -105,8 +105,7 @@ public class ProductApplicationImpl implements ProductApplication {
}
}
manager.flush();
manager.close();
Map<Object, Object> selectedBrand = convertToMap(Brand.class, "brandName", brands);
Map<Object, Object> selectedFactory = convertToMap(Factory.class, "factoryName", factorys);
Map<Object, Object> selectedColor = convertToMap(Color.class, "colorId", colors);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment