• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Postgresql Connection [fixed] => [working with serial columns]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Postgresql Connection [fixed] => wodev.com (wiki)
      • From: LD <email@hidden>
    • Re: Postgresql Connection [fixed] => [working with serial columns]
      • From: Hunter Hillegas <email@hidden>
References: 
 >Re: Postgresql Connection (again) - failure to create primary keys (From: LD <email@hidden>)
 >Re: Postgresql Connection (again) - failure to create primary keys (From: LD <email@hidden>)

  • Prev by Date: Re: WebObjects 5.2.4
  • Next by Date: Re: Postgresql Connection [fixed] => [working with serial columns]
  • Previous by thread: Re: Postgresql Connection (again) - failure to create primary keys
  • Next by thread: Re: Postgresql Connection [fixed] => [working with serial columns]
  • Index(es):
    • Date
    • Thread