following on from this question:
Apache Cayenne: user-defined tables: examples?
As part of my design, I'm intending to allow operations which modify the database schema at run time. As discussed in the above question, it does seem that Cayenne supports this.
I was interested in how I can supply my new project definition to the ServerRuntime, without using the file system.
After looking at the source it looks as though I have two options:
(1) Implement a custom classloader, set it as the thread-local class loader, and allow Cayenne to find it using ClassLoaderResourceLocator.
(2) Implement a custom ResourceLocator, and bind it in using injection.
It is pretty clear how I would do (1) but arguably (2) is a bit neater as it doesn't rely on the behaviour of ClassLoaderResourceLocator.
Is (2) reasonable, and how would I code this?