On 03.10.2008, at 23:55, Yung-Luen Lan wrote:
I'm now connect my wo app to 3rd party banking service. According to their API, I need to provide a "transaction id" that is unique for each transaction or I'll get error.Sure, it can be done by creating an entity class and use PK as a unique id. But I don't want to create the entity class since I don't need that. What I want is just like this: SELECT nextval('serial'); Can I do this in webobjects?
You can, but I'd think really hard about not making an entity. What I'd do is creating a Transaction entity and a sequence in the database, populate an attribute of a new transaction with a value from the sequence (look at EOUtilities.rawRowsForSQL to see how to use the direct SQL) and store that transaction in the database - update it with status, log, whatever information you get from the banking service. Make the transaction id column unique in the database too, but don't use the primary key (that is considered bad style).
Just as a friendly advise ... cug -- Real World WebObjects Bootcamp at the Big Nerd Ranch: http://www.bignerdranch.com/classes/real-world_webobjects.shtml _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
