Maybe I'm missing something simple, but I can't seem to figure out a way to use multiple databases. I need to be able to allow the user to create multiple databases, all with the same schema, and pick which database they need to work with when the application starts up.
After casually browsing the source code, It seems that the table mappings are intimately linked with the database described in the XML mapping file. Because of this, it seems like I'll have to generate a new mapping file for each database the user creates. Is there a way to omit a database connection in the XML and instead dynamically add a database to the PersistenceBroker at runtime and have it use the table/column mappings in the XML file?
I'll generate separate mapping files for each database if I must, but I'm really hoping a cleaner solution is out there. Thanks for any assistance!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is actually a reafture request for this sort of thing outstanding - events for missing parameters.
At the moment, my only suggestion is to modify the XML file at runtime with the needed parameters before calling the init() method of the persistence broker. It's not clean but it should work until I get the other change done.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe I'm missing something simple, but I can't seem to figure out a way to use multiple databases. I need to be able to allow the user to create multiple databases, all with the same schema, and pick which database they need to work with when the application starts up.
After casually browsing the source code, It seems that the table mappings are intimately linked with the database described in the XML mapping file. Because of this, it seems like I'll have to generate a new mapping file for each database the user creates. Is there a way to omit a database connection in the XML and instead dynamically add a database to the PersistenceBroker at runtime and have it use the table/column mappings in the XML file?
I'll generate separate mapping files for each database if I must, but I'm really hoping a cleaner solution is out there. Thanks for any assistance!
There is actually a reafture request for this sort of thing outstanding - events for missing parameters.
At the moment, my only suggestion is to modify the XML file at runtime with the needed parameters before calling the init() method of the persistence broker. It's not clean but it should work until I get the other change done.
Sounds good! Guess I should've thought to look in the feature request section as well. :)
Thanks for the reply. Glad to know those are being worked on!