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: LD <email@hidden>
- Date: Thu, 5 May 2005 13:37:48 +1000
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:
This email sent to email@hidden