This file is indexed.

/usr/share/doc/php-doctrine-orm/html/reference/faq.html is in doctrine-orm-doc 2.4.6-1+deb8u1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>4. Frequently Asked Questions &mdash; Doctrine 2 ORM 2 documentation</title>
    <link rel="stylesheet" href="../_static/bootstrap/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/layout.css" type="text/css" />
    <link rel="stylesheet" href="../_static/configurationblock.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>

    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/configurationblock.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/configurationblock.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/configurationblock.js"></script>
    <script src="../_static/bootstrap/js/bootstrap.min.js"></script>

    <script type="text/javascript">
    <!--
        $(document).ready(function() {
            $("#versions").change(function() {
                var docsUrl = $(this).val();
                window.location.href = docsUrl;
            });
        });
    -->
    </script>
    <link rel="shortcut icon" href="../_static/doctrine.ico"/>
    <link rel="top" title="Doctrine 2 ORM 2 documentation" href="../index.html" />
    <link rel="next" title="5. Basic Mapping" href="basic-mapping.html" />
    <link rel="prev" title="3. Installation and Configuration" href="configuration.html" /> 
  </head>
  <body>
    <div id="wrapper">
      <div id="header">
        <h1 id="h1title"></h1>
        <div id="logo">
          <a href="http://www.doctrine-project.org/">Doctrine - PHP Database Libraries</a>
        </div>
      </div>
      <div id="nav" class="cls">
        <div class="tl cls">
          <ul>
            <li><a target="_top" href="/">home</a></li>
            <li><a class="" target="_top" href="http://www.doctrine-project.org/about">about</a></li>
            <li><a class="" target="_top" href="http://www.doctrine-project.org/projects.html">projects</a></li>
            <li><a class="" target="_top" href="http://www.doctrine-project.org/projects/orm">orm</a></li>
            <li><a class="" target="_top" href="http://www.doctrine-project.org/projects/dbal">dbal</a></li>
            <li><a class="" target="_top" href="http://www.doctrine-project.org/blog">blog</a></li>
            <li><a class="" target="_top" href="http://www.doctrine-project.org/jira">development</a></li>
            <li><a class="" target="_top" href="http://www.doctrine-project.org/contribute">contribute</a></li>
            <li><a class="" target="_top" href="http://www.doctrine-project.org/community">community</a></li>
          </ul>
        </div>
      </div>
      <div id="content" class="cls">
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="basic-mapping.html" title="5. Basic Mapping"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="configuration.html" title="3. Installation and Configuration"
             accesskey="P">previous</a> |</li>
        <li><a href="/">Doctrine Homepage</a> &raquo;</li>
        <li><a href="../index.html">Doctrine 2 ORM 2 documentation</a> &raquo;</li> 
      </ul>
    </div>  

        <div class="document">
            <div class="documentwrapper">
                <div class="bodywrapper">

              <div class="body" >
                
  <div class="section" id="frequently-asked-questions">
<h1>4. Frequently Asked Questions<a class="headerlink" href="#frequently-asked-questions" title="Permalink to this headline"></a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This FAQ is a work in progress. We will add lots of questions and not answer them right away just to remember
what is often asked. If you stumble across an unanswered question please write a mail to the mailing-list or
join the #doctrine channel on Freenode IRC.</p>
</div>
<div class="section" id="database-schema">
<h2>4.1. Database Schema<a class="headerlink" href="#database-schema" title="Permalink to this headline"></a></h2>
<div class="section" id="how-do-i-set-the-charset-and-collation-for-mysql-tables">
<h3>4.1.1. How do I set the charset and collation for MySQL tables?<a class="headerlink" href="#how-do-i-set-the-charset-and-collation-for-mysql-tables" title="Permalink to this headline"></a></h3>
<p>You can&#8217;t set these values inside the annotations, yml or xml mapping files. To make a database
work with the default charset and collation you should configure MySQL to use it as default charset,
or create the database with charset and collation details. This way they get inherited to all newly
created database tables and columns.</p>
</div>
</div>
<div class="section" id="entity-classes">
<h2>4.2. Entity Classes<a class="headerlink" href="#entity-classes" title="Permalink to this headline"></a></h2>
<div class="section" id="i-access-a-variable-and-its-null-what-is-wrong">
<h3>4.2.1. I access a variable and its null, what is wrong?<a class="headerlink" href="#i-access-a-variable-and-its-null-what-is-wrong" title="Permalink to this headline"></a></h3>
<p>If this variable is a public variable then you are violating one of the criteria for entities.
All properties have to be protected or private for the proxy object pattern to work.</p>
</div>
<div class="section" id="how-can-i-add-default-values-to-a-column">
<h3>4.2.2. How can I add default values to a column?<a class="headerlink" href="#how-can-i-add-default-values-to-a-column" title="Permalink to this headline"></a></h3>
<p>Doctrine does not support to set the default values in columns through the &#8220;DEFAULT&#8221; keyword in SQL.
This is not necessary however, you can just use your class properties as default values. These are then used
upon insert:</p>
<div class="highlight-php"><div class="highlight"><pre><span class="x">class User</span>
<span class="x">{</span>
<span class="x">    const STATUS_DISABLED = 0;</span>
<span class="x">    const STATUS_ENABLED = 1;</span>

<span class="x">    private $algorithm = &quot;sha1&quot;;</span>
<span class="x">    private $status = self:STATUS_DISABLED;</span>
<span class="x">}</span>
</pre></div>
</div>
<p>.</p>
</div>
</div>
<div class="section" id="mapping">
<h2>4.3. Mapping<a class="headerlink" href="#mapping" title="Permalink to this headline"></a></h2>
<div class="section" id="why-do-i-get-exceptions-about-unique-constraint-failures-during-em-flush">
<h3>4.3.1. Why do I get exceptions about unique constraint failures during <tt class="docutils literal"><span class="pre">$em-&gt;flush()</span></tt>?<a class="headerlink" href="#why-do-i-get-exceptions-about-unique-constraint-failures-during-em-flush" title="Permalink to this headline"></a></h3>
<p>Doctrine does not check if you are re-adding entities with a primary key that already exists
or adding entities to a collection twice. You have to check for both conditions yourself
in the code before calling <tt class="docutils literal"><span class="pre">$em-&gt;flush()</span></tt> if you know that unique constraint failures
can occur.</p>
<p>In <a class="reference external" href="http://www.symfony.com">Symfony2</a> for example there is a Unique Entity Validator
to achieve this task.</p>
<p>For collections you can check with <tt class="docutils literal"><span class="pre">$collection-&gt;contains($entity)</span></tt> if an entity is already
part of this collection. For a FETCH=LAZY collection this will initialize the collection,
however for FETCH=EXTRA_LAZY this method will use SQL to determine if this entity is already
part of the collection.</p>
</div>
</div>
<div class="section" id="associations">
<h2>4.4. Associations<a class="headerlink" href="#associations" title="Permalink to this headline"></a></h2>
<div class="section" id="what-is-wrong-when-i-get-an-invalidargumentexception-a-new-entity-was-found-through-the-relationship">
<h3>4.4.1. What is wrong when I get an InvalidArgumentException &#8220;A new entity was found through the relationship..&#8221;?<a class="headerlink" href="#what-is-wrong-when-i-get-an-invalidargumentexception-a-new-entity-was-found-through-the-relationship" title="Permalink to this headline"></a></h3>
<p>This exception is thrown during <tt class="docutils literal"><span class="pre">EntityManager#flush()</span></tt> when there exists an object in the identity map
that contains a reference to an object that Doctrine does not know about. Say for example you grab
a &#8220;User&#8221;-entity from the database with a specific id and set a completely new object into one of the associations
of the User object. If you then call <tt class="docutils literal"><span class="pre">EntityManager#flush()</span></tt> without letting Doctrine know about
this new object using <tt class="docutils literal"><span class="pre">EntityManager#persist($newObject)</span></tt> you will see this exception.</p>
<p>You can solve this exception by:</p>
<ul class="simple">
<li>Calling <tt class="docutils literal"><span class="pre">EntityManager#persist($newObject)</span></tt> on the new object</li>
<li>Using cascade=persist on the association that contains the new object</li>
</ul>
</div>
<div class="section" id="how-can-i-filter-an-association">
<h3>4.4.2. How can I filter an association?<a class="headerlink" href="#how-can-i-filter-an-association" title="Permalink to this headline"></a></h3>
<p>Natively you can&#8217;t filter associations in 2.0 and 2.1. You should use DQL queries to query for the filtered set of entities.</p>
</div>
<div class="section" id="i-call-clear-on-a-one-to-many-collection-but-the-entities-are-not-deleted">
<h3>4.4.3. I call clear() on a One-To-Many collection but the entities are not deleted<a class="headerlink" href="#i-call-clear-on-a-one-to-many-collection-but-the-entities-are-not-deleted" title="Permalink to this headline"></a></h3>
<p>This is an expected behavior that has to do with the inverse/owning side handling of Doctrine.
By definition a One-To-Many association is on the inverse side, that means changes to it
will not be recognized by Doctrine.</p>
<p>If you want to perform the equivalent of the clear operation you have to iterate the
collection and set the owning side many-to-one reference to NULL as well to detach all entities
from the collection. This will trigger the appropriate UPDATE statements on the database.</p>
</div>
<div class="section" id="how-can-i-add-columns-to-a-many-to-many-table">
<h3>4.4.4. How can I add columns to a many-to-many table?<a class="headerlink" href="#how-can-i-add-columns-to-a-many-to-many-table" title="Permalink to this headline"></a></h3>
<p>The many-to-many association is only supporting foreign keys in the table definition
To work with many-to-many tables containing extra columns you have to use the
foreign keys as primary keys feature of Doctrine introduced in version 2.1.</p>
<p>See <a class="reference internal" href="../tutorials/composite-primary-keys.html"><em>the tutorial on composite primary keys for more information</em></a>.</p>
</div>
<div class="section" id="how-can-i-paginate-fetch-joined-collections">
<h3>4.4.5. How can i paginate fetch-joined collections?<a class="headerlink" href="#how-can-i-paginate-fetch-joined-collections" title="Permalink to this headline"></a></h3>
<p>If you are issuing a DQL statement that fetches a collection as well you cannot easily iterate
over this collection using a LIMIT statement (or vendor equivalent).</p>
<p>Doctrine does not offer a solution for this out of the box but there are several extensions
that do:</p>
<ul class="simple">
<li><a class="reference external" href="http://github.com/beberlei/DoctrineExtensions">DoctrineExtensions</a></li>
<li><a class="reference external" href="http://github.com/whiteoctober/pagerfanta">Pagerfanta</a></li>
</ul>
</div>
<div class="section" id="why-does-pagination-not-work-correctly-with-fetch-joins">
<h3>4.4.6. Why does pagination not work correctly with fetch joins?<a class="headerlink" href="#why-does-pagination-not-work-correctly-with-fetch-joins" title="Permalink to this headline"></a></h3>
<p>Pagination in Doctrine uses a LIMIT clause (or vendor equivalent) to restrict the results.
However when fetch-joining this is not returning the correct number of results since joining
with a one-to-many or many-to-many association multiplies the number of rows by the number
of associated entities.</p>
<p>See the previous question for a solution to this task.</p>
</div>
</div>
<div class="section" id="inheritance">
<h2>4.5. Inheritance<a class="headerlink" href="#inheritance" title="Permalink to this headline"></a></h2>
<div class="section" id="can-i-use-inheritance-with-doctrine-2">
<h3>4.5.1. Can I use Inheritance with Doctrine 2?<a class="headerlink" href="#can-i-use-inheritance-with-doctrine-2" title="Permalink to this headline"></a></h3>
<p>Yes, you can use Single- or Joined-Table Inheritance in Doctrine 2.</p>
<p>See the documentation chapter on <a class="reference internal" href="inheritance-mapping.html"><em>inheritance mapping</em></a> for
the details.</p>
</div>
<div class="section" id="why-does-doctrine-not-create-proxy-objects-for-my-inheritance-hierarchy">
<h3>4.5.2. Why does Doctrine not create proxy objects for my inheritance hierarchy?<a class="headerlink" href="#why-does-doctrine-not-create-proxy-objects-for-my-inheritance-hierarchy" title="Permalink to this headline"></a></h3>
<p>If you set a many-to-one or one-to-one association target-entity to any parent class of
an inheritance hierarchy Doctrine does not know what PHP class the foreign is actually of.
To find this out it has to execute a SQL query to look this information up in the database.</p>
</div>
</div>
<div class="section" id="entitygenerator">
<h2>4.6. EntityGenerator<a class="headerlink" href="#entitygenerator" title="Permalink to this headline"></a></h2>
<div class="section" id="why-does-the-entitygenerator-not-do-x">
<h3>4.6.1. Why does the EntityGenerator not do X?<a class="headerlink" href="#why-does-the-entitygenerator-not-do-x" title="Permalink to this headline"></a></h3>
<p>The EntityGenerator is not a full fledged code-generator that solves all tasks. Code-Generation
is not a first-class priority in Doctrine 2 anymore (compared to Doctrine 1). The EntityGenerator
is supposed to kick-start you, but not towards 100%.</p>
</div>
<div class="section" id="why-does-the-entitygenerator-not-generate-inheritance-correctly">
<h3>4.6.2. Why does the EntityGenerator not generate inheritance correctly?<a class="headerlink" href="#why-does-the-entitygenerator-not-generate-inheritance-correctly" title="Permalink to this headline"></a></h3>
<p>Just from the details of the discriminator map the EntityGenerator cannot guess the inheritance hierarchy.
This is why the generation of inherited entities does not fully work. You have to adjust some additional
code to get this one working correctly.</p>
</div>
</div>
<div class="section" id="performance">
<h2>4.7. Performance<a class="headerlink" href="#performance" title="Permalink to this headline"></a></h2>
<div class="section" id="why-is-an-extra-sql-query-executed-every-time-i-fetch-an-entity-with-a-one-to-one-relation">
<h3>4.7.1. Why is an extra SQL query executed every time I fetch an entity with a one-to-one relation?<a class="headerlink" href="#why-is-an-extra-sql-query-executed-every-time-i-fetch-an-entity-with-a-one-to-one-relation" title="Permalink to this headline"></a></h3>
<p>If Doctrine detects that you are fetching an inverse side one-to-one association
it has to execute an additional query to load this object, because it cannot know
if there is no such object (setting null) or if it should set a proxy and which id this proxy has.</p>
<p>To solve this problem currently a query has to be executed to find out this information.</p>
</div>
</div>
<div class="section" id="doctrine-query-language">
<h2>4.8. Doctrine Query Language<a class="headerlink" href="#doctrine-query-language" title="Permalink to this headline"></a></h2>
<div class="section" id="what-is-dql">
<h3>4.8.1. What is DQL?<a class="headerlink" href="#what-is-dql" title="Permalink to this headline"></a></h3>
<p>DQL stands for Doctrine Query Language, a query language that very much looks like SQL
but has some important benefits when using Doctrine:</p>
<ul class="simple">
<li>It uses class names and fields instead of tables and columns, separating concerns between backend and your object model.</li>
<li>It utilizes the metadata defined to offer a range of shortcuts when writing. For example you do not have to specify the ON clause of joins, since Doctrine already knows about them.</li>
<li>It adds some functionality that is related to object management and transforms them into SQL.</li>
</ul>
<p>It also has some drawbacks of course:</p>
<ul class="simple">
<li>The syntax is slightly different to SQL so you have to learn and remember the differences.</li>
<li>To be vendor independent it can only implement a subset of all the existing SQL dialects. Vendor specific functionality and optimizations cannot be used through DQL unless implemented by you explicitly.</li>
<li>For some DQL constructs subselects are used which are known to be slow in MySQL.</li>
</ul>
</div>
<div class="section" id="can-i-sort-by-a-function-for-example-order-by-rand-in-dql">
<h3>4.8.2. Can I sort by a function (for example ORDER BY RAND()) in DQL?<a class="headerlink" href="#can-i-sort-by-a-function-for-example-order-by-rand-in-dql" title="Permalink to this headline"></a></h3>
<p>No, it is not supported to sort by function in DQL. If you need this functionality you should either
use a native-query or come up with another solution. As a side note: Sorting with ORDER BY RAND() is painfully slow
starting with 1000 rows.</p>
</div>
</div>
<div class="section" id="a-query-fails-how-can-i-debug-it">
<h2>4.9. A Query fails, how can I debug it?<a class="headerlink" href="#a-query-fails-how-can-i-debug-it" title="Permalink to this headline"></a></h2>
<p>First, if you are using the QueryBuilder you can use
<tt class="docutils literal"><span class="pre">$queryBuilder-&gt;getDQL()</span></tt> to get the DQL string of this query. The
corresponding SQL you can get from the Query instance by calling
<tt class="docutils literal"><span class="pre">$query-&gt;getSQL()</span></tt>.</p>
<div class="highlight-php"><div class="highlight"><pre><span class="cp">&lt;?php</span>
<span class="nv">$dql</span> <span class="o">=</span> <span class="s2">&quot;SELECT u FROM User u&quot;</span><span class="p">;</span>
<span class="nv">$query</span> <span class="o">=</span> <span class="nv">$entityManager</span><span class="o">-&gt;</span><span class="na">createQuery</span><span class="p">(</span><span class="nv">$dql</span><span class="p">);</span>
<span class="nb">var_dump</span><span class="p">(</span><span class="nv">$query</span><span class="o">-&gt;</span><span class="na">getSQL</span><span class="p">());</span>

<span class="nv">$qb</span> <span class="o">=</span> <span class="nv">$entityManager</span><span class="o">-&gt;</span><span class="na">createQueryBuilder</span><span class="p">();</span>
<span class="nv">$qb</span><span class="o">-&gt;</span><span class="na">select</span><span class="p">(</span><span class="s1">&#39;u&#39;</span><span class="p">)</span><span class="o">-&gt;</span><span class="na">from</span><span class="p">(</span><span class="s1">&#39;User&#39;</span><span class="p">,</span> <span class="s1">&#39;u&#39;</span><span class="p">);</span>
<span class="nb">var_dump</span><span class="p">(</span><span class="nv">$qb</span><span class="o">-&gt;</span><span class="na">getDQL</span><span class="p">());</span>
</pre></div>
</div>
</div>
</div>


              </div>
                </div>

            </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
             
            <div id="searchbox" style="">
              <h3>Search</h3>
                <form class="search" action="http://readthedocs.org/search/project/" method="get">
                  <input type="text" name="q" size="18">
                  <input type="submit" value="Go">
                  <input type="hidden" name="selected_facets" value="project:">
                </form>
            </div>
            <h3><a href="../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference internal" href="#">4. Frequently Asked Questions</a><ul>
<li><a class="reference internal" href="#database-schema">4.1. Database Schema</a><ul>
<li><a class="reference internal" href="#how-do-i-set-the-charset-and-collation-for-mysql-tables">4.1.1. How do I set the charset and collation for MySQL tables?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#entity-classes">4.2. Entity Classes</a><ul>
<li><a class="reference internal" href="#i-access-a-variable-and-its-null-what-is-wrong">4.2.1. I access a variable and its null, what is wrong?</a></li>
<li><a class="reference internal" href="#how-can-i-add-default-values-to-a-column">4.2.2. How can I add default values to a column?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#mapping">4.3. Mapping</a><ul>
<li><a class="reference internal" href="#why-do-i-get-exceptions-about-unique-constraint-failures-during-em-flush">4.3.1. Why do I get exceptions about unique constraint failures during <tt class="docutils literal"><span class="pre">$em-&gt;flush()</span></tt>?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#associations">4.4. Associations</a><ul>
<li><a class="reference internal" href="#what-is-wrong-when-i-get-an-invalidargumentexception-a-new-entity-was-found-through-the-relationship">4.4.1. What is wrong when I get an InvalidArgumentException &#8220;A new entity was found through the relationship..&#8221;?</a></li>
<li><a class="reference internal" href="#how-can-i-filter-an-association">4.4.2. How can I filter an association?</a></li>
<li><a class="reference internal" href="#i-call-clear-on-a-one-to-many-collection-but-the-entities-are-not-deleted">4.4.3. I call clear() on a One-To-Many collection but the entities are not deleted</a></li>
<li><a class="reference internal" href="#how-can-i-add-columns-to-a-many-to-many-table">4.4.4. How can I add columns to a many-to-many table?</a></li>
<li><a class="reference internal" href="#how-can-i-paginate-fetch-joined-collections">4.4.5. How can i paginate fetch-joined collections?</a></li>
<li><a class="reference internal" href="#why-does-pagination-not-work-correctly-with-fetch-joins">4.4.6. Why does pagination not work correctly with fetch joins?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#inheritance">4.5. Inheritance</a><ul>
<li><a class="reference internal" href="#can-i-use-inheritance-with-doctrine-2">4.5.1. Can I use Inheritance with Doctrine 2?</a></li>
<li><a class="reference internal" href="#why-does-doctrine-not-create-proxy-objects-for-my-inheritance-hierarchy">4.5.2. Why does Doctrine not create proxy objects for my inheritance hierarchy?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#entitygenerator">4.6. EntityGenerator</a><ul>
<li><a class="reference internal" href="#why-does-the-entitygenerator-not-do-x">4.6.1. Why does the EntityGenerator not do X?</a></li>
<li><a class="reference internal" href="#why-does-the-entitygenerator-not-generate-inheritance-correctly">4.6.2. Why does the EntityGenerator not generate inheritance correctly?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#performance">4.7. Performance</a><ul>
<li><a class="reference internal" href="#why-is-an-extra-sql-query-executed-every-time-i-fetch-an-entity-with-a-one-to-one-relation">4.7.1. Why is an extra SQL query executed every time I fetch an entity with a one-to-one relation?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#doctrine-query-language">4.8. Doctrine Query Language</a><ul>
<li><a class="reference internal" href="#what-is-dql">4.8.1. What is DQL?</a></li>
<li><a class="reference internal" href="#can-i-sort-by-a-function-for-example-order-by-rand-in-dql">4.8.2. Can I sort by a function (for example ORDER BY RAND()) in DQL?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#a-query-fails-how-can-i-debug-it">4.9. A Query fails, how can I debug it?</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="configuration.html"
                                  title="previous chapter">3. Installation and Configuration</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="basic-mapping.html"
                                  title="next chapter">5. Basic Mapping</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/reference/faq.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
        </div>
      </div>
          <div class="clearer"></div>
        </div>
          <div class="footer">
              &copy; Copyright 2010-12, Doctrine Project Team.
              Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2.3.
            <br/>
            <a target="_BLANK" href="http://www.servergrove.com"><img src="../_static/servergrove.jpg" /></a>      <br/><br/>
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
              <input type="hidden" name="cmd" value="_s-xclick" />
              <input type="hidden" name="hosted_button_id" value="BAE2E3XANQ77Y" />
              <input type="Submit" value="Donate via PayPal" />
            </form>
          </div>
      </div>

      <div id="bot-rcnr">
        <div class="tl"><!-- corner --></div>
      </div>
    </div>

  <a class="githublink" href="http://github.com/doctrine">Fork me on GitHub</a>
  </body>
</html>