<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Fri May 24 21:25:46 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-776/DDC-776.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-776] Persisters use a fixed &quot;SELECT&quot; SQL statements</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-776</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;I am currently trying to work with BINARY columns with Doctrine 2 and MSSQL. In order to get my Entities working I had to create a custom Mapping Type for Binary columns. All went well in this case and I&apos;ve got it running.&lt;/p&gt;

&lt;p&gt;The problem arises when I am attempting to use Associative mapping (OneToOne/ManyToMany). The problem is, in order to do a select for an SQL column, I had to create a DQL function called &quot;CONVERT&quot; so that I use WHERE statements:&lt;/p&gt;

&lt;p&gt;            return $this-&amp;gt;createQueryBuilder(&apos;u&apos;)&lt;br/&gt;
                -&amp;gt;where(&quot;u.id = CONVERT(&apos;binary&apos;, :id, 1)&quot;)&lt;br/&gt;
                -&amp;gt;setParameter(&apos;id&apos;, $id)&lt;br/&gt;
                -&amp;gt;getQuery()&lt;br/&gt;
                -&amp;gt;getSingleResult();&lt;/p&gt;

&lt;p&gt;As you see, I must do this in order to get a result.&lt;/p&gt;

&lt;p&gt;However, when I&apos;m using associative mapping; this is what it does:&lt;/p&gt;

&lt;p&gt;        return &apos;SELECT &apos; . $this-&amp;gt;_getSelectColumnListSQL() &lt;br/&gt;
             . &apos; FROM &apos; . $this-&amp;gt;_class-&amp;gt;getQuotedTableName($this-&amp;gt;_platform) . &apos; &apos;&lt;br/&gt;
             . $this-&amp;gt;_getSQLTableAlias($this-&amp;gt;_class-&amp;gt;name)&lt;br/&gt;
             . $joinSql&lt;br/&gt;
             . ($conditionSql ? &apos; WHERE &apos; . $conditionSql : &apos;&apos;)&lt;br/&gt;
             . $orderBySql &lt;br/&gt;
             . $lockSql;&lt;/p&gt;

&lt;p&gt;As you can see, its some what hard coded and I cannot change it without changing the actual code in &lt;br/&gt;
Doctrine\ORM\Persisters\BasicEntityPersister.php&lt;/p&gt;

&lt;p&gt;So, I would first like to know if there was maybe a way you could allow us to customize the SELECT statement that the persisters use - or maybe (though I&apos;m not sure how this will be done) make them use user-defined repository functions?&lt;/p&gt;

&lt;p&gt;Like $myRepo-&amp;gt;find($identifier)&lt;/p&gt;

&lt;p&gt;Not entirely sure if I explained this properly and I do realize my circumstance is highly odd - but this does seem like a limitation and because of this I cannot use associative mapping.&lt;/p&gt;</description>
                <environment>Windows 7, Apache 2.2, MSSQL Server, PHP 5.3.3</environment>
            <key id="11845">DDC-776</key>
            <summary>Persisters use a fixed &quot;SELECT&quot; SQL statements</summary>
                <type id="4" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/improvement.png">Improvement</type>
                                <priority id="3" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/major.png">Major</priority>
                    <status id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/open.png">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10000">All</security>
                        <assignee username="romanb">Roman S. Borschel</assignee>
                                <reporter username="aarondm">Aaron DM</reporter>
                        <labels>
                    </labels>
                <created>Sun, 29 Aug 2010 13:52:27 +0000</created>
                <updated>Tue, 23 Apr 2013 12:09:39 +0000</updated>
                                    <version>2.0-BETA3</version>
                                                        <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="20094" author="locs" created="Tue, 23 Apr 2013 12:09:39 +0000"  >&lt;p&gt;Hi, i try to make my custom type for binary field in MSSQL.&lt;br/&gt;
I don&apos;t find own, can you please show me your custom type binary?&lt;br/&gt;
Thks a lot.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>