• 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: Duplicate objects in a relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicate objects in a relationship


  • Subject: Re: Duplicate objects in a relationship
  • From: Simon McLean <email@hidden>
  • Date: Mon, 18 Jun 2007 00:22:55 +0100

Hi Chuck - I am using inheritance, but of the single table variety:

Is the restricting qualifier unique across all entities? Do the abstract ones have a restricting qualifier?

Yes, and yes.

Client has a parent called AbstractOrganisation, EmployeeRole has a parent called AbstractUserRole which are mapped to ABSTRACT_ORGANISATION and ABSTRACT_USER_ROLE tables. The problematic relationship is inherited from the parent - so getRoles () actually returns an array of AbstractUserRoles, and the reverse relationship getOrganisation() returns an AbstractOrganisation.

I tried moving the relationships from the parent down to the child objects, but I get the same behavior. I've also checked the tables for duplicate PK's but there aren't any.

Iterate over the objects in client.getRoles() and print out getClass ().getName(), entityName(), and hashCode() on each. I suspect you may get a surprise.

Here is the output:

com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
5627611
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
10105184
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
2082210
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
5627611
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
10105184
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
2082210
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
5627611
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
10105184
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
2082210
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
5627611
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
10105184
com.clicktravel.travelsystem.EmployeeRole
EmployeeRole
2082210

Which suggests there are definitely duplicates in there.

I've also noticed that not all Client objects are affected. In fact, it looks like only a handful are. I guess this points to a data error ?

Simon
_______________________________________________
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: Duplicate objects in a relationship
      • From: Chuck Hill <email@hidden>
    • RE: Duplicate objects in a relationship
      • From: "Ruenagel, Frank" <email@hidden>
    • Re: Duplicate objects in a relationship
      • From: Paul Lynch <email@hidden>
References: 
 >Duplicate objects in a relationship (From: Simon McLean <email@hidden>)
 >Re: Duplicate objects in a relationship (From: Chuck Hill <email@hidden>)
 >Re: Duplicate objects in a relationship (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: irc channel
  • Next by Date: Re: WWDC
  • Previous by thread: Re: Duplicate objects in a relationship
  • Next by thread: Re: Duplicate objects in a relationship
  • Index(es):
    • Date
    • Thread