class table inheritance

0 views
Skip to first unread message

Rico Leuthold

unread,
Apr 4, 2011, 7:53:52 AM4/4/11
to flextrine
Hi,

I'm having a problem with class table inheritance. The (php) entity
classes look as follows:

/**
* @Entity
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="discriminator", type="string")
* @DiscriminatorMap({"box_check" = "BoxCheck", "other_location_check"
= "OtherLocationCheck"})
* @Table(name="locationcheck")
*/
class LocationCheck{ ... }

**
* @Entity
* @Table(name="boxcheck")
*/
class BoxCheck extends LocationCheck { ... }

/**
* @Entity
* @Table(name="otherlocationcheck")
*/
class OtherLocationCheck extends LocationCheck { ... }

The resulting as3 entities like this:

public interface LocationCheckInterfaceBase { ... }

public interface LocationCheck { ... }

public class OtherLocationCheckEntityBase extends EventDispatcher
{ ... }

public class BoxCheckEntityBase extends EventDispatcher { ... }

Based on the documentation in the flextrine wiki I expect
OtherLocationCheckEntityBase and BoxCheckEntityBase to implement
LocationCheckInterfaceBase or LocationCheck.

Is this an issue or am I doing something stupid?

Thank you - rico




Dave Keen

unread,
Apr 4, 2011, 8:05:09 AM4/4/11
to flex...@googlegroups.com
Hey Rico,

In AS3 It is the child class itself that implements the CTI parent, so you'd expect:

public class BoxCheck extends BoxCheckEntityBase implements LocationCheck { ... }

Perhaps if these child classes already existed they aren't being regenerated by the command line tool - have a go deleting all the AS3 entities or using the --regenerate-entities flag and see if it works better.  I am currently coding a project which uses this and it should work :)  (although I guess the other side of it is that I might have already generated my child AS3 entities whilst it was still working and introduced a bug since then ;) )

Dave
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.894 / Virus Database: 271.1.1/3548 - Release Date: 04/03/11 19:40:00

Rico Leuthold

unread,
Apr 4, 2011, 8:32:17 AM4/4/11
to flex...@googlegroups.com
Hey Dave,

In AS3 It is the child class itself that implements the CTI parent, so you'd expect:

public class BoxCheck extends BoxCheckEntityBase implements LocationCheck { ... }

Ah I see - didn't expect that :-)

Just out of curiosity - what is the reason, the child class implements the interface and not the base class?


Perhaps if these child classes already existed they aren't being regenerated by the command line tool - have a go deleting all the AS3 entities or using the --regenerate-entities flag and see if it works better.

Exactly that was the problem in my case.

  I am currently coding a project which uses this and it should work :)  (although I guess the other side of it is that I might have already generated my child AS3 entities whilst it was still working and introduced a bug since then ;) )

It works like a charm - no bug introduced :-)

As always - thank you very much.

- rico

Rico Leuthold

unread,
Apr 4, 2011, 8:39:28 AM4/4/11
to flex...@googlegroups.com
Hi Dave,

In AS3 It is the child class itself that implements the CTI parent, so you'd expect:

public class BoxCheck extends BoxCheckEntityBase implements LocationCheck { ... }

Ah I see - didn't expect that :-)

Just out of curiosity - what is the reason, the child class implements the interface and not the base class?

Perhaps if these child classes already existed they aren't being regenerated by the command line tool - have a go deleting all the AS3 entities or using the --regenerate-entities flag and see if it works better.

Yep - this was my problem.

  I am currently coding a project which uses this and it should work :)  (although I guess the other side of it is that I might have already generated my child AS3 entities whilst it was still working and introduced a bug since then ;) )

It works like a charm - no bug introduced :-)

As always - thank you very much.

- rico

Reply all
Reply to author
Forward
0 new messages