Add classLoader to mapper options builder#1394
Merged
evanchooly merged 1 commit intoMorphiaOrg:masterfrom Oct 31, 2019
Merged
Conversation
Member
|
Have you tried this with 1.5.7? It was just published in the last day or two and I've done a fair bit of work in this exact area. |
Author
|
@evanchooly Yeah, just tried with 1.5.7 -- the classLoader variable is read-only in the MapperOptions class and there is no option for it in the builder |
Member
|
and it's still necessary? That's disappointing... Not the end of the world, though, i guess. It's a nice escape hatch, I suppose, for when morphia can't quite figure it all out. I'll take a look in the next day or two then. |
Author
|
@evanchooly Yeah, just for some use cases where we need to provide our own class loader. |
Member
|
I just pushed 1.5.8 so you should see this on central in the next hour or two. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is necessary for some use cases (for example, when working with Spigot/Bukkit JavaPlugins) (see https://spigotmc.org) when the
PluginClassLoaderis used. In order to preventNoClassDefFoundErrorfor entity classes, theJavaPlugin's ClassLoader needs to be used, and I'm sure this is applicable to other applications as well.Example of my use in the previous version (when it was possible to override the DefaultCreator's
getClassLoaderForClass()method):Example usage with this commit: