ilgrosso commented on PR #220:
URL: https://github.com/apache/openjpa/pull/220#issuecomment-6364412726

   It looks like one reason of a few test failures is that the following test 
code:
   
   ```java
   User rossini = userDAO.findByUsername("rossini").orElseThrow();
   
   PlainAttr loginDate = rossini.getPlainAttr("loginDate").orElseThrow();
   
loginDate.getValues().getFirst().setDateValue(FormatUtils.parseDate(LOGIN_DATE_VALUE,
 "yyyy-MM-dd"));
   
   entityManager.merge(rossini);
   ```
   does not generate any `UPDATE` statement while this code:
   
   ```java
   User rossini = userDAO.findByUsername("rossini").orElseThrow();
   
   PlainAttr loginDate = rossini.getPlainAttr("loginDate").orElseThrow();
   rossini.remove(loginDate);
   
loginDate.getValues().getFirst().setDateValue(FormatUtils.parseDate(LOGIN_DATE_VALUE,
 "yyyy-MM-dd"));
   rossini.add(loginDate);
   
   entityManager.merge(rossini);
   ```
   
   does.
   
   In the first snippet, the converted `List<PlainAttr>` is read 
(`getPlainAttr()` does `getPlainAttrs().filter(...).findFirst()` internally) 
and one of its element is modified.
   
   In the second snippet, the converted `List<PlainAttr>` is actually modified.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to