0 votes

received by email

other issue i'm having now with an inheritance. The exporter ALWAYS removes the Id from child, even if the parent mappedSuperClass does not have an ID.

ormd file:

<entity name="Meta">
  <field name="created" type="datetime"/>
  <field name="modified" type="datetime"/>
  <field name="status" type="integer"/>
  <inheritance-parent type="MAPPED_SUPERCLASS"/>
</entity>
<entity name="Person">
  <field name="id" type="integer" primary="true" auto-increment="true"/>
  <field name="person_code" type="string" size="11" unique="true"/>
  <field name="date_of_birth" type="date"/>
  <field name="date_of_death" type="date"/>
  <field name="gender" type="integer"/>
  <field name="language" type="integer"/>
  <field name="customer_id" type="integer" unique="true"/>
  <inheritance-child derived-from="Meta" caption="meta"/>
</entity>

export file:

/** 
 * @ORM\Entity
 */
class Person extends Meta
{

///////////////NO ID!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    /** 
     * @ORM\Column(type="string", unique=true, length=11, nullable=true)
     */
    private $person_code;

....

The exporter really should check the parent for id, before omitting the id from child, right?!

in Solved by Skipper developer (141k points)

1 Answer

0 votes
Best answer

Fixed. This fix will be available in upcoming 2.2.0 version

ORM Designer now can export both primary keys (base class and derived class). Base class primary key has higher priority. Derived class primary key is used only when base class doesn't contain primary key.

by Skipper developer (141k points)
selected by