-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Improve configurability of EmbeddedDatabaseBuilder [SPR-11410] #16037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Juergen Hoeller commented The EmbeddedDatabaseBuilder gets created with an EmbeddedDatabaseFactory and a ResourceDatabasePopulator that's being set on that EmbeddedDatabaseFactory... Accepting an external EmbeddedDatabaseFactory reference doesn't seem to be ideal here since we'd have to apply our ResourceDatabasePopulator to it, effectively modifying the state of the EmbeddedDatabaseFactory and not just delegating to it. Juergen |
Jon Osborn commented Ok with that but how do we put properties on the factory? For example, I can't find a way to set 'ignore drops' using java with |
Juergen Hoeller commented Good point. We could either mirror all relevant EmbeddedDatabaseFactory options there, or provide a "getFactory()" accessor that allows for further fine-tuning. I'll revisit this for 4.0.2 still. Juergen |
Jon Osborn commented both getDatabaseFactory() and getDatabasePopulator(), please. |
Juergen Hoeller commented Looking at this stylistically and practically, it might make sense to simply use EmbeddedDatabaseFactory with a ResourceDatabasePopulator and skip the builder. There isn't that much benefit in EmbeddedDatabaseBuilder anymore once you start calling setters on the factory and the populator directly: only really the addScript variant with a String location and the part with the default scripts. Would it make more sense to add those script conveniences to ResourceDatabasePopulator instead, for direct use without a builder? Juergen |
Jon Osborn commented yes...I think the builder is a little overkill if we are going to just delegate everything. Developers would probably still like the convenience of the builder type of syntax for unit tests. It is very easy to understand and setup quite easily using the |
Sam Brannen commented Resolved as described in the comments for GitHub commit dc6d675:
|
Sam Brannen commented As can be seen in the updated Javadoc for
|
Martin Ahrer opened SPR-11410 and commented
Internally EmbeddedDatabaseBuilder delegates creation of the database instance to a factory. It would be helpful if that could be an injection target (setter or constructor).
Affects: 4.0.1
Issue Links:
Referenced from: commits dc6d675
1 votes, 5 watchers
The text was updated successfully, but these errors were encountered: