Hello, Marco!

Thanks for the answer.
Another thing though, is it possible to explicitly tell the ORM what are
the columns it is supposed to use foi joining purposes?

For example, it is performing something like

select wakawaka
> from person t0
> join employee t1
> on t0.pid = t1.pid


but I'd like it to specify the column name to be joined in t1, since "pid"
is not the correct name. Suppose it is "personid" in that table. Still, the
ORM keeps using "pid", even though it does not exist. =(

select wakawaka
> from person t0
> join employee t1
> on t0.pid = *t1.personid*


Thanks a lot!

Best regards from Brazil,

*Thales Vaz Maciel*
Bacharel em Sistemas de Informação - Universidade da Região da Campanha,
Bagé, RS, Brasil
Especialista em Sistemas Distribuídos - Universidade Federal do Pampa,
Bagé, RS, Brasil
Mestrando em Engenharia de Computação - Universidade Federal do Rio Grande,
Rio Grande, RS, Brasil
Informata de Nível Superior - Prefeitura Municipal de Bagé, Bagé, RS, Brasil
http://lattes.cnpq.br/7166030596636868
F: +55 (53) 99419258 (novo)

2016-07-06 22:19 GMT-03:00 Marco Pivetta <[email protected]>:

> Hey Tales,
>
> No, the ORM won't be able to support what you want there. The current
> persisters/hydrators for JTI and STI structures require a discriminator
> column to be defined and populated with correct information.
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://ocramius.github.com/
>
> On 7 July 2016 at 02:00, Thales Maciel <[email protected]> wrote:
>
>> Hello!
>>
>> Is there a way to produce OO inheritance without providing a
>> discriminator column and a discriminator map?
>> Instead, I'd like to specify the name of the column to be used to
>> reference the top-most entity's table's primary key. Seems that doctrine2
>> automatically assumes the foreign key's name to be the same as the
>> referenced tables' primary key's name, which often isn't the case for
>> legacy databases.
>>
>> Instead of what is in red, I'd like to do something like what is in
>> green. =)
>>
>> <?phpnamespace MyProject\Model;
>>> /** * @Entity *@Table(name="person")* * @InheritanceType("JOINED")* * 
>>> @DiscriminatorColumn(name="discr", type="string")
>>>  * @DiscriminatorMap({"person" = "Person", "employee" = "Employee"})* 
>>> */class Person{
>>>     // ...}
>>> /** @Entity *@Table(name="employee") @JoinColumn(name="employee.person_id", 
>>> referencedColumnName="person.id <http://person.id>")* */
>>>
>>> class Employee extends Person{
>>>     // ...}
>>>
>>>
>>
>> Thanks a lot for the help.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "doctrine-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/doctrine-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "doctrine-user" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/doctrine-user/b9u2IGS_LYE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to