Re: "failed to provide new primary keys for entity"
Re: "failed to provide new primary keys for entity"
- Subject: Re: "failed to provide new primary keys for entity"
- From: Johnny Miller <email@hidden>
- Date: Wed, 24 Feb 2010 09:14:36 -1000
Sure. Thanks a lot David!
see below...
Lahaina:MAPModel.eomodeld jlmiller$ more MAP_ImageGallery.plist
{
attributes = (
{
allowsNull = Y;
columnName = "CREATE_DATE";
name = createDate;
prototypeName = dateTime;
},
{allowsNull = N; name = id; prototypeName = id; },
{
allowsNull = N;
columnName = "PERSON_ID";
name = personID;
prototypeName = id;
},
{
allowsNull = Y;
columnName = TITLE;
name = title;
prototypeName = varchar255;
},
{allowsNull = Y; columnName = TYPE; name = type; prototypeName = intNumber; }
);
attributesUsedForLocking = (id, personID);
className = "com.map.eo.ImageGallery";
classProperties = (createDate, images, person, title, type);
externalName = GALLERY;
fetchSpecificationDictionary = {};
name = "MAP_ImageGallery";
parent = "MAP_Gallery";
primaryKeyAttributes = (id);
relationships = (
{definition = "mAP_GalleryImages.image"; name = images; },
{
deleteRule = EODeleteRuleCascade;
destination = "MAP_GalleryImage";
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = galleryID; sourceAttribute = id; });
name = "mAP_GalleryImages";
propagatesPrimaryKey = Y;
},
{
destination = "MAP_Person";
isMandatory = Y;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = id; sourceAttribute = personID; });
name = person;
}
);
restrictingQualifier = "type=0";
}
Lahaina:MAPModel.eomodeld jlmiller$ more MAP_GalleryImage.plist
{
attributes = (
{
allowsNull = N;
columnName = "GALLERY_ID";
name = galleryID;
prototypeName = id;
},
{allowsNull = N; columnName = "IMAGE_ID"; name = imageID; prototypeName = id; },
{
allowsNull = Y;
columnName = POSITION;
name = position;
prototypeName = intNumber;
}
);
attributesUsedForLocking = (galleryID, imageID);
className = "com.map.eo.GalleryImage";
classProperties = (gallery, image, position);
externalName = "GALLERY_IMAGE";
fetchSpecificationDictionary = {};
name = "MAP_GalleryImage";
primaryKeyAttributes = (galleryID, imageID);
relationships = (
{
destination = "MAP_ImageGallery";
isMandatory = Y;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = id; sourceAttribute = galleryID; });
name = gallery;
},
{
destination = "MAP_Image";
isMandatory = Y;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = id; sourceAttribute = imageID; });
name = image;
}
);
}
Lahaina:MAPModel.eomodeld jlmiller$ more MAP_Image.plist
{
attributes = (
{
allowsNull = Y;
columnName = "CODE_NAME";
name = codeName;
prototypeName = varchar50;
},
{
allowsNull = Y;
columnName = HEIGHT;
name = height;
prototypeName = intNumber;
},
{allowsNull = N; columnName = ID; name = id; prototypeName = id; },
{
allowsNull = Y;
columnName = "MIME_TYPE";
name = mimeType;
prototypeName = varchar16;
},
{
allowsNull = N;
columnName = "PERSON_ID";
name = personID;
prototypeName = id;
},
{
allowsNull = Y;
columnName = "PICTURE_ID";
name = pictureID;
prototypeName = id;
},
{allowsNull = Y; columnName = TITLE; name = title; prototypeName = varchar50; },
{allowsNull = Y; columnName = TYPE; name = type; prototypeName = intNumber; },
{allowsNull = Y; columnName = WIDTH; name = width; prototypeName = intNumber; }
);
attributesUsedForLocking = (id, personID);
className = "com.map.eo.Image";
classProperties = (
codeName,
galleries,
height,
mimeType,
person,
picture,
pictureID,
title,
type,
width
);
externalName = MEDIA;
fetchSpecificationDictionary = {};
name = "MAP_Image";
parent = "MAP_Media";
primaryKeyAttributes = (id);
relationships = (
{definition = "mAP_GalleryImages.gallery"; name = galleries; },
{
deleteRule = EODeleteRuleCascade;
destination = "MAP_GalleryImage";
isToMany = Y;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = imageID; sourceAttribute = id; });
name = "mAP_GalleryImages";
propagatesPrimaryKey = Y;
},
{
destination = "MAP_Person";
isMandatory = Y;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = id; sourceAttribute = personID; });
name = person;
},
{
deleteRule = EODeleteRuleCascade;
destination = ERFileAttachment;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = id; sourceAttribute = pictureID; });
name = picture;
}
);
restrictingQualifier = "type=0";
}
On Feb 24, 2010, at 9:08 AM, David Avendasora wrote:
>
> On Feb 24, 2010, at 2:02 PM, Chuck Hill wrote:
>
>>
>> On Feb 24, 2010, at 10:53 AM, Johnny Miller wrote:
>>
>>> Hi,
>>>
>>> I'm still stuck >:(
>>>
>>> I thought this information might be helpful.
>>>
>>> If I do a System.out on entity.primaryKeyAttributeNames() I see the right keys.
>>>
>>> If I System.out on the relationships I can see they are properly set and not null.
>>>
>>> Yet, if I System.out on entity.primaryKey I get a return of null.
>>>
>>> Could this be a bug in the MySQL plugin?
>>
>> It is almost certainly a defect in your model.
>
> + 1
>
> Can you paste the contents of the plist files (or attache the plist files themselves) for all the entities involved in the relationships?
>
> I've had times where everything looks fine in Entity Modeler, but the plists have problems.
>
> Dave
>
>
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