Hi Marco, and thanks for your answer

I made a few more test and i think there is a bug somewhere in Doctrine. 
Considering my above exemple the sql table corresponding to my SubClass 
should contain both fields 'application' and 'user'

In Doctrine\ORM\Tools\SchemaTool line 210 :

$idMapping = $class->fieldMappings[$identifierField];

Here $class is the metadata of SubClass but the fieldMappings property only 
contains the additional fields of SubClass, not the 'application' and 
'user' which are identifiers and should be reported in the joined table


If i change my definition, as you suggested, to:

@Entity @InheritanceType("JOINED")
BaseClass
    $id    => @Id
    $application => @ManyToOne
    $user => @ManyToOne

SubClass extends BaseClass

Then in the $class->fieldMappings property i have the id column which has 
been reported from the parent, and so everything works fine


Can you give more information about the kind of messy problems encoutered 
with identies though foreign identity, it seems to me like a regular use 
case in many situations ...

Thanks for the help




Le mardi 20 janvier 2015 11:47:43 UTC+1, Marco Pivetta a écrit :
>
> Hi Tom,
>
> On 20 January 2015 at 10:32, Tom <[email protected] <javascript:>> 
> wrote:
>
>> Hello,
>>
>> I'm having trouble setting up my hierarchy. Here is what i want to 
>> achieve:
>>
>> @Entity @InheritanceType("JOINED")
>> BaseClasse
>>     $application => @Id @ManyToOne
>>     $user          => @Id @ManyToOne
>>
>> SubClass extends BaseClass
>>
>> Which leads me to the following exception:
>> [InvalidArgumentException] Incomplete definition. 'columns' required.
>>
>>
>> Is this use case supported by Doctrine ?
>>
>
> This use-case should actually be supported, but identities through a 
> foreign identity are usually discouraged since there are a lot of messy 
> problems that you may run into.
>
> Consider validating your mappings first.
>
> Marco Pivetta 
>
> http://twitter.com/Ocramius      
>
> http://ocramius.github.com/ 
>

-- 
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 http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to