0

I have 2 entity's

AlienImage.cfc MonsterImage.cfc

Both these entity's inherit from Image.cfc which contains the name of the image.

My issue is that when I use to use the following....

World.cfc property name="images" singularname="image" type="array" fieldtype="one-to-many" cfc="AlienImage" fkcolumn="worldID" cascade="all" remotingFetch="true";

when I load world.cfc remotingFetch on this relationship SHOULD bring back image name too since AlienImage extends image.cfc with it in, but now image is blank, why?

Is this a bug in CF ORM????

"DATA": [
        {
            "worldname": "some world",
            "images": [
                {}
            ],

        }
    ], 
Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
Prometheus
  • 32,405
  • 54
  • 166
  • 302
  • Try w/o remote fetching and see if it works first? Turn on SQL logging. – Henry May 14 '12 at 16:18
  • 1
    Have you defined Image.cfc as a base class using mappedSuperClass=true (and removing the persistent attribute)? http://stackoverflow.com/questions/6992178/ – CfSimplicity May 15 '12 at 07:54
  • yes that what I have on the image tables. I see all the fields in the database from the extended table but don't show when I dump! – Prometheus May 15 '12 at 10:45
  • ok, so what I have worked out is this works differently to how 'i think' it should! after reading this > http://www.terrenceryan.com/blog/post.cfm/some-things-about-mappedsuperclass-in-coldfusion-9-0-1 I moved the persisted properties and only left dynamic getters and setters in the image.cfc. This seemed to work but totally the wrong way around! – Prometheus May 15 '12 at 11:42

1 Answers1

2

My suggestion would be to double check the database tables and make sure that your join or subselect for worldID (PK for "some world") actually ties to an image. The data does not appear to be saved correctly.

Mark A Kruger
  • 7,183
  • 20
  • 21
  • I see all the fields in the database from the extended table so ImageMonster has the fields in DB view from Image, but they don't show when I dump them only the relationship with world shows. – Prometheus May 15 '12 at 10:47
  • ok, so what I have worked out is this works differently to how 'i think' it should! after reading this > http://www.terrenceryan.com/blog/post.cfm/some-things-about-mappedsuperclass-in-coldfusion-9-0-1 I moved the persisted properties and only left dynamic getters and setters in the image.cfc. This seemed to work but totally the wrong way around! o well – Prometheus May 15 '12 at 11:41
  • 1
    Glad you got it sorted out... I'll take a look at the post. – Mark A Kruger May 15 '12 at 13:13