Skip to content


DDC-142: Join columns can't be quoted #2044

doctrinebot opened this Issue · 6 comments

1 participant


Jira issue originally created by user reinier.kip:

Join columns can't be quoted like columns using name="quoted". Using annotation driver.

Not sure where this would occur. AnnotationDriver? ORM? DBAL?


Comment created by romanb:

Actually this should work already. Can you give an example that doesnt work?

Of course, this quoting is really only a workaround. Its best to avoid it altogether by avoiding reserved words.


Comment created by romanb:

If you're interested in how the quoting works at all currently, see one of my comments here:[DDC-88](


Comment created by reinier.kip:

I used

@OneToOne(targetEntity="FlowElement", cascade={"persist"}, fetch="EAGER")
@JoinColumn(name="`then`", referencedColumnName="id")

In OneToOneMapping#getQuotedJoinColumnName($joinColumn, $platform) it does this:

isset($this->joinColumns[$joinColumn]['quoted']) ?  $platform->quoteIdentifier($joinColumn) : $joinColumn;

while $this->joinColumns contains this:

    [0] => Array
            [name] => then
            [referencedColumnName] => id
            [unique] => 
            [nullable] => 1
            [onDelete] => 
            [onUpdate] => 
            [quoted] => 1


Comment created by romanb:

I see. Thanks. Either the join columns need to be indexed by name or the method must be changed but the former is probably more effective. It might have some side-effects to watch out for when changing that though. Scheduling for A4 for now.


Comment created by romanb:

After some discussion support for quoting join column names and discriminator column names has been dropped for the sake of simplicity.

Quoting table names and regular column names will continue to be supported.

The docs have been updated accordingly.


Issue was closed with resolution "Won't Fix"

@doctrinebot doctrinebot added this to the 2.0-BETA1 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.