Thanks for the info. I was looking at Henning's mapbuilder-init patch and that looks like a good basic solution. What are the reasons this hasn't been added in?
Only thing I think should be done different is that the class should be part of the package defined for map files, but that's not a biggie. If you need to init the full Database map, just call this class. Otherwise, just do things normally. I can live with that restriction on getting full map info when it's needed. However, if some folks still want a way to init all TableMaps when Torque is initialized, here's a possible way to have a automatic initialization of the Map structure. Have the generator create a property file like <DB>MapInit.properties in the map package. This would have a single property with the name of the <DB>Init class. Then, TorqueInstance.initDatabaseMap could find the DB init class by using a getResource(<DB>MapInit.properties) call to find the properties file from the classpath and invoking the initClass. The advantage to this is that there is no extra parameters to be set in the Torque.properties file. Well, maybe we wrap the code that runs the <DB>Init class with a check for a new optional dataBaseProperty, e.g. torque.database.<db>.initMap = true | false. This would not be a big rewrite to the existing code. > -----Original Message----- > From: Thomas Fischer [mailto:[EMAIL PROTECTED] > Sent: Monday, January 30, 2006 2:57 AM > To: Apache Torque Developers List > Subject: RE: Torque dbMaps and MapBuilder question > > > "Greg Monroe" <[EMAIL PROTECTED]> schrieb am 27.01.2006 23:43:46: > > > I'm starting to design the XML import function (to go with the XML > > Export I just added to Scarab). So, I've been wandering deeply > > in the mapping code. In a scary sort of way, I understand it all.. > > but there seems to be one piece that I might not understand. > > > > Is it true that the only way DatabaseMaps get TableMaps > > added to them is if the code explicitly calls either the > > Table specific Peer getMapBuilder() method or the Table > > specific MapBuilder.build() methods? > > This is correct. > > > > > So, this is why getting the DatabaseMap from Torque will not > > return all TableMaps when asked? > > Yes, this will probably be the reason. Each Map will be added > when the Peer > classes are build. See > http://issues.apache.org/scarab/issues/id/TRQS228 > for a discussion. > > > > > Sigh, anyone know a way to get a list of all tables in a database > > from the TorqueRuntime? > > You would have to autogenerate a piece of code which loads > all the Peer > classes. This should be tied to a switch in the runtime configuration, > which is normally off, but when on it executes this piece of code. > > Thomas > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > Duke CE Privacy Statement Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
