Re: postgresql serial columns and wonder
Re: postgresql serial columns and wonder
- Subject: Re: postgresql serial columns and wonder
- From: Theodore Petrosky <email@hidden>
- Date: Sat, 17 Apr 2010 20:44:14 -0700 (PDT)
Thank you.... primaryKey() is working for my needs. I didn't want to do a separate query... I have a couple of relations and I eventually wanted a string that was something like:
<td><wo:WOString value = "$current.client.clientCode"/>-<wo:WOString value = "$current.products.productCode"/>-<wo:WOString value = "$current.primaryKey" /></td>
so I end up with a display of:
MRK-M-1001
I just tested this and it is perfect...
Ted
--- On Sat, 4/17/10, Guido Neitzer <email@hidden> wrote:
> From: Guido Neitzer <email@hidden>
> Subject: Re: postgresql serial columns and wonder
> To: "WebObjects-Dev Mailing List List" <email@hidden>
> Cc: "Theodore Petrosky" <email@hidden>
> Date: Saturday, April 17, 2010, 11:12 PM
> On 17. Apr, 2010, at 19:49 , Theodore
> Petrosky wrote:
>
> > I want to expose the primary key to be part of my
> entity. (At least this is what I think I want.)
>
> Maybe you want this, but is it what you need? I'd say, you
> have several options:
>
> In awakeFromInsertion you could query (probably just raw
> sql) a specific "jobnumber_sequence" in the DB and populate
> the job number with that value.
>
> If you only use this for display purpose, you could use
> "primaryKey()" which gives you the primary key of the row.
> If you call "primaryKeyInTransaction" Wonder will query the
> database for a pk for a newly created object and you can
> display this.
>
> Personally, I'd use a separate sequence that is independent
> of the pk.
>
> cug
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden