Community
Participate
Working Groups
EclipseLink create temporary table wrong column types for CriteriaUpdate. DB: MySQL. For example, Product id name price ------------------------------------------ bigint(20) varchar(30) decimal(19,2) Set product price: CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder(); CriteriaUpdate<Product> criteriaUpdate = criteriaBuilder.createCriteriaUpdate(Product.class); Root<Product> root = criteriaUpdate.from(Product.class); criteriaUpdate.set(root.get("price"), 6.05); em.createQuery(criteriaUpdate).executeUpdate(); A temporary table will be created for updateALL, and the price column type is decimal(37), not consistent with decimal(19,2). As a result, For example, 6.05 will become 6. Is this a bug? https://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg04987.html If you never use this case you can override in MySQLPlatform: public boolean shouldAlwaysUseTempStorageForModifyAll() { return false; } and will get the same behavior in UpdateAll/DeleteAll as on other database platforms.. Do I need to change EclipseLink source code for this? is there a way to configure it in persistence.xml? Thanks.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink