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

Closed
opened 2026-01-22 12:29:40 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 13, 2009).

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?

Originally created by @doctrinebot on GitHub (Nov 13, 2009). 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?
admin added the Bug label 2026-01-22 12:29:40 +01:00
admin closed this issue 2026-01-22 12:29:41 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 13, 2009):

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.

@doctrinebot commented on GitHub (Nov 13, 2009): 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.
Author
Owner

@doctrinebot commented on GitHub (Nov 13, 2009):

Comment created by romanb:

If you're interested in how the quoting works at all currently, see one of my comments here: http://www.doctrine-project.org/jira/browse/DDC-88

@doctrinebot commented on GitHub (Nov 13, 2009): Comment created by romanb: If you're interested in how the quoting works at all currently, see one of my comments here: http://www.doctrine-project.org/jira/browse/[DDC-88](http://www.doctrine-project.org/jira/browse/DDC-88)
Author
Owner

@doctrinebot commented on GitHub (Nov 13, 2009):

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:

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

)
@doctrinebot commented on GitHub (Nov 13, 2009): 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: ``` Array ( [0] => Array ( [name] => then [referencedColumnName] => id [unique] => [nullable] => 1 [onDelete] => [onUpdate] => [quoted] => 1 ) ) ```
Author
Owner

@doctrinebot commented on GitHub (Nov 13, 2009):

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.

@doctrinebot commented on GitHub (Nov 13, 2009): 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.
Author
Owner

@doctrinebot commented on GitHub (Mar 5, 2010):

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.

@doctrinebot commented on GitHub (Mar 5, 2010): 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.
Author
Owner

@doctrinebot commented on GitHub (Mar 5, 2010):

Issue was closed with resolution "Won't Fix"

@doctrinebot commented on GitHub (Mar 5, 2010): Issue was closed with resolution "Won't Fix"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#177