Re: Do entities require a primary key?
Re: Do entities require a primary key?
- Subject: Re: Do entities require a primary key?
- From: Chuck Hill <email@hidden>
- Date: Wed, 9 Dec 2009 15:35:36 -0800
On Dec 9, 2009, at 3:25 PM, Johnny Miller wrote:
The table has two columns an "IP_FROM" and an "IP_TO", each contains
an IP number.
According to the manual after you convert an IP address to an IP
number it can only resolve to one row in the database i.e.
IP_FROM <= X <= IP_TO
So, I'd assume that the multi-column PK would work because the combo
of IP_FROM and IP_TO has to be unique. I've never created column pk
like that before - can I find the info in the Apple supplied docs?
Nothing to it, just mark both as primary key columns in Entity
Modeler. Look at a many to many join table for an example.
Chuck
re: raw SQL. Yeah, I planned on that.
Thanks a lot,
Johnny
On Dec 9, 2009, at 1:12 PM, Chuck Hill wrote:
Are the rows unique? If so, you can make a multi-column PK. EOF
needs _something_ to uniquely identify them if you want to make EOs
out of the data. You might also want to consider just raw SQL
(raw rows) and / or making a cache of these and avoiding the EO
overhead.
Chuck
On Dec 9, 2009, at 3:04 PM, Johnny Miller wrote:
Hi,
I just purchased a database that does IP address to country
resolution. I'm reverse engineering the database into a Wonder
Framework and I realized that the single table in the database
doesn't have a primary key. WOLips doesn't like this and throws
an error stating the entity does not have a primary key.
Should I just create a primary key field and leave it blank? Or
is there a better alternative? This is going to be a read only
database.
Thanks in advance,
Johnny Miller
Kahalawai Media Corp
http://www.kahalawai.com
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
Johnny Miller
Kahalawai Media Corp
http://www.kahalawai.com
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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