Re: Postgresql Connection [fixed] => [working with serial columns]
Re: Postgresql Connection [fixed] => [working with serial columns]
- Subject: Re: Postgresql Connection [fixed] => [working with serial columns]
- From: Hunter Hillegas <email@hidden>
- Date: Wed, 4 May 2005 22:26:42 -0700
FYI, we use the WONDER version for a site that gets tens of millions
of visitors per month and it works great.
On May 4, 2005, at 8:37 PM, LD wrote:
Hi all,
I haven't looked at the Project Wonder version of PostgresqlPlugin
(I couldn't see it as a separate download) but the following fix to
the hexdreams version fixes the problem...
public NSArray newPrimaryKeys (int count, EOEntity entity,
JDBCChannel channel) {
<...>
// original Hexdreams code:
//sequenceName = entity.primaryKeyRootName() + "_SEQ";
// BEGIN FIX:
// According to Postgres docs:
// http://www.postgresql.org/docs/faqs.FAQ.html#4.11.2
// sequenceName form: <entityName>_<pkColumnName>_SEQ
sequenceName = entity.primaryKeyRootName();
sequenceName += "_";
sequenceName += ((EOAttribute)entity.primaryKeyAttributes
().objectAtIndex(0)).columnName();
sequenceName += "_SEQ";
// END FIX
expression = new PostgresqlExpression(entity);
expression.setStatement("SELECT NEXTVAL('" + sequenceName + "')");
results = new NSMutableArray();
priKeyAttributeName = ((EOAttribute)entity.primaryKeyAttributes
().objectAtIndex(0)).name();
<...>
}
what would be interesting to know is 'what is the jdbc driver
missing for this plug-in to be needed at all?'
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
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