@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private String fullName;
private String extName;
private Long extId;
private String extKey;
private String extUrl;
private String description;
private String category;
private Double priceMin;
private Double priceMax;
@JdbcTypeCode(SqlTypes.JSON)
private Map<String, Object> attributes;
}
@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
Product getByExtKey(String key);
Document document = Jsoup.connect(onlinerProduct.getHtmlUrl()).maxBodySize(0). timeout(0).get();
table = document.select("div.product-specs__main-group");
productData = new ProductData();
productData.setKey(onlinerProduct.getKey());
productData.setData(table.html());
productDataRepository.save(productData);
Product product = new Product();
product = parse(table, configParser);
product.setExtUrl(extrProduct.getHtmlUrl());
product.setCategory(configParser.getCategory());
product.setName(extProduct.getName());
product.setFullName(extProduct.getFullName());
......
productRepository.save(product);</b>
Hibernate: update product
растет с каждым
Hibernate: insertp roduct
Другие инсерты на это не влияют.
Тут как то все завязано на особенностях JSON о которых я не знаю.