That's what I thought since I did not see anything in TR.props related to the ID Broker directly. I'll just mod the IDBroker.
Thanks, Scott -----Original Message----- From: Jason van Zyl [mailto:[EMAIL PROTECTED]] Sent: Monday, December 03, 2001 11:09 AM To: Turbine Users List Subject: Re: Implementing a custom ID Broker On 12/3/01 11:04 AM, "Weaver, Scott" <[EMAIL PROTECTED]> wrote: > I want to something real simple. I just want extend then use a custom > version of an ID broker. > > Basically, all I want to do is to append the table name to plus and "@" sign > to the beginning of an autogenerated key (String only, obviously) like so: > Extend org.apache.turbine.util.db.IDBroker then override getIdAsString > > String getIdAsString(Connection connection, Object tableName) > { > return tableName+"@"+(getIdAsBigDecimal(null, > tableName).toString()); > } > > This will, theoretically, create system-wide, unique ID for this row. > > Okay, that was the simple part. The part I'm missing is how to convince > Turbine to use my ID Broker Class instead of the default one. > > Any clues? For expediency you should just modify the current IDBroker to do what you want the IDBroker isn't pluggalbe at the moment. The IDBroker implements the IdGenerator interface so you could make something similar to the IDBroker but you would have to modify Torque to allow pluggable IdGenerators. It's coming but won't be there soon and as you need it now I suggest just modifying the IDBroker class. It's probably easy to make this pluggable in Torque but it will require some testing. > Thanks, > Scott > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- jvz. Jason van Zyl http://tambora.zenplex.org http://jakarta.apache.org/turbine http://jakarta.apache.org/velocity http://jakarta.apache.org/alexandria http://jakarta.apache.org/commons -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
