• 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
subEntityForEntity never called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subEntityForEntity never called?


  • Subject: subEntityForEntity never called?
  • From: "email@hidden" <email@hidden>
  • Date: Mon, 31 Oct 2016 03:54:13 +0100

Hello there,

I must be missing something darn obvious, for my subEntityForEntity delegate method never gets called. My code looks like this:

===
class ModelGroupDelegate {
    EOEntity subEntityForEntity(EOEntity entity,NSDictionary dic) {
        println "&&&&&& fetching '$entity' $dic"
        null
    }
}
... ... ...
mdg.delegate=new ModelGroupDelegate()
println "&&&&&& MY MDG DELEGATE: ${mdg.delegate()}"
EOEntity rece=mdg.entityNamed('DBRecord')
println "&&&&&& subentities of $rece.name: $rece.subEntities.count: $rece.subEntities.name"
EOEntity rec2=mdg.entityNamed('DBRecord2')
EOEntity rec3=mdg.entityNamed('DBRecord3')
println "&&&&&& r2p($rec2.name) $rec2.parentEntity.name / r3p($rec3.name) $rec3.parentEntity.name"
def fs=new EOFetchSpecification('DBRecord',null,null)
fs.fetchLimit=10 // there's a LOT of records, limiting for test
def got=new ERXEC().objectsWithFetchSpecification(fs) // should use subEntityForEntity, should it not?!?
println "&&&&&& fetched $got.count objects all right in entities ${got*.entityName()}"
System.exit(0)
===

and it never tries to call subEntityForEntity; instead, for whatever darned reason, it forces DBRecord3:

===
&&&&&& MY MDG DELEGATE: cz.ocs.model.ModelGroupDelegate@7db534f2
&&&&&& subentities of DBRecord: 2: [DBRecord3, DBRecord2]
&&&&&& r2p(DBRecord2) DBRecord / r3p(DBRecord3) DBRecord
&&&&&& fetched 10 objects all right in entities [DBRecord3, DBRecord3, DBRecord3, DBRecord3, DBRecord3, DBRecord3, DBRecord3, DBRecord3, DBRecord3, DBRecord3]
APPLICATION SHUTDOWN SEQUENCE COMPLETE
====

Any idea what might I be doing wrong?

Thanks a lot,
OC


 _______________________________________________
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


  • Prev by Date: Development setup for Mac OS X Sierra
  • Next by Date: Re: Using WOInject with an intermediate WOApplication subclass
  • Previous by thread: Development setup for Mac OS X Sierra
  • Next by thread: reverse engineered DB
  • Index(es):
    • Date
    • Thread