rzo1 commented on code in PR #186:
URL: https://github.com/apache/openjpa/pull/186#discussion_r4018165574


##########
openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceUnitInfoImpl.java:
##########
@@ -650,17 +655,40 @@ public static PersistenceUnitInfoImpl 
convert(PersistenceConfiguration config) {
                pinfo.setTransactionType(config.transactionType() == 
jakarta.persistence.PersistenceUnitTransactionType.JTA ? 
                                PersistenceUnitTransactionType.JTA : 
PersistenceUnitTransactionType.RESOURCE_LOCAL);
                pinfo.setValidationMode(config.validationMode());
-               List<Class<?>> managedClasses = config.managedClasses();
-               if (managedClasses != null && !managedClasses.isEmpty()) {
-                       String managedClassesList = 
managedClasses.stream().map(Class::getName).collect(Collectors.joining(";"));
-                       String old = 
config.properties().containsKey("openjpa.MetaDataFactory")
-                                       ? "," + 
config.properties().get("openjpa.MetaDataFactory").toString()
-                                       : "";
-                       config.property("openjpa.MetaDataFactory", "jpa(Types=" 
+ managedClassesList + old + ")");
+               for (Class<?> managedClass : config.managedClasses()) {

Review Comment:
   `PersistenceConfiguration` sets `managedClasses` (and `mappingFileNames`) up 
as `private final List<...> = new ArrayList<>()` and 
`managedClasses()`/`mappingFiles()` return those lists directly, so they can't 
be null. Only a subclass overriding the accessor to return `null` could break 
that, and that would violate the API. The old code didn't null-check 
`config.properties()` either.



-- 
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