Support for jMolecules' Association type.

We no recognize properties of type org.jmolecules.ddd.types.Association as associations in our PersistentProperty model.

Also, we now register JMolecules Converter implementations for Association and Identifier in CustomConversions so that they can persisted like their embedded primitive value out of the box.

Fixes #2315.
Original pull request: #2316.
This commit is contained in:
Oliver Drotbohm
2021-02-26 11:30:52 +01:00
committed by Mark Paluch
parent 3f1609587e
commit 6b0292cc66
9 changed files with 146 additions and 9 deletions

View File

@@ -475,4 +475,21 @@ public final class ReflectionUtils {
throw new IllegalArgumentException(String.format("Primitive type %s not supported!", type));
}
/**
* Loads the class with the given name using the given {@link ClassLoader}.
*
* @param name the name of the class to be loaded.
* @param classLoader the {@link ClassLoader} to use to load the class.
* @return the {@link Class} or {@literal null} in case the class can't be loaded for any reason.
* @since 2.5
*/
@Nullable
public static Class<?> loadIfPresent(String name, ClassLoader classLoader) {
try {
return ClassUtils.forName(name, classLoader);
} catch (Exception o_O) {
return null;
}
}
}