Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0-ALPHA3
    • Fix Version/s: 2.0-BETA1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

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

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

        Activity

        Hide
        Roman S. Borschel added a comment - - edited

        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.

        Show
        Roman S. Borschel added a comment - - edited 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.
        Hide
        Roman S. Borschel added a comment -

        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

        Show
        Roman S. Borschel added a comment - 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
        Hide
        Reinier Kip added a comment -

        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
                )
        
        )
        
        Show
        Reinier Kip added a comment - 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 ) )
        Hide
        Roman S. Borschel added a comment -

        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.

        Show
        Roman S. Borschel added a comment - 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.
        Hide
        Roman S. Borschel added a comment -

        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.

        Show
        Roman S. Borschel added a comment - 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.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Reinier Kip
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: