• 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
UUID question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UUID question


  • Subject: UUID question
  • From: Theodore Petrosky <email@hidden>
  • Date: Tue, 28 Jun 2016 06:09:44 -0400

I am starting a new little project and I want to use the UUIDs. My migrations usually start up by inserting a few entities by executing some SQL. 

The id column is not a ‘real’ postgresql UUID, it is a 128 bit bytea column. I figured out a way to use UUIDUtilities.generateAsNSData use that value to insert my entity.

String theSQL = "INSERT INTO person (active, firstname, creationdate, id) VALUES " +
"(true, 'Ted', now(), decode(E'" + UUIDUtilities.generateAsNSData()._hexString() + "', 'hex'))";
 

ERXJDBCUtilities.executeUpdate(database.adaptorChannel(),  theSQL);


It works, but is there a better way or more correct way to create the bytea attribute to insert.



Ted


 _______________________________________________
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: UUID question
      • From: Samuel Pelletier <email@hidden>
    • Re: UUID question
      • From: Paul Hoadley <email@hidden>
  • Prev by Date: Re: EODrinkingContext Corruption
  • Next by Date: Re: UUID question
  • Previous by thread: Re: EODrinkingContext Corruption
  • Next by thread: Re: UUID question
  • Index(es):
    • Date
    • Thread