Doctrine Projecthttp://www.doctrine-project.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+10032+AND+labels+%3D+MappedSuperclass
An XML representation of a search requesten-us6.2.3626015-04-2014[DDC-3597] [GH-1321] embeddedClasses support in mapped superclasseshttp://www.doctrine-project.org/jira/browse/DDC-3597
Doctrine 2 - ORM<p>This issue is created to fixing this issue: <a href="https://github.com/doctrine/DoctrineModule/issues/481" class="external-link" rel="nofollow">https://github.com/doctrine/DoctrineModule/issues/481</a></p>
<p>Url: <a href="https://github.com/doctrine/doctrine2/pull/1321" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1321</a></p>
<p>Message:</p>
<p>...for JoinedSubclassPersister.php</p>DDC-3597[GH-1321] embeddedClasses support in mapped superclassesBugMajorResolvedFixedAllMarco PivettaDoctrine BotembeddablesinheritancemappedsuperclassTue, 3 Mar 2015 10:42:07 +0000Tue, 10 Mar 2015 20:54:31 +0000Tue, 10 Mar 2015 20:53:58 +00002.5Mapping DriversORM01<p>A related Github Pull-Request <span class="error">&#91;GH-1321&#93;</span> was assigned:<br/>
<a href="https://github.com/doctrine/doctrine2/pull/1321" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1321</a></p><p>A related Github Pull-Request <span class="error">&#91;GH-1321&#93;</span> was merged:<br/>
<a href="https://github.com/doctrine/doctrine2/pull/1321" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1321</a></p><p>A related Github Pull-Request <span class="error">&#91;GH-1321&#93;</span> was labeled:<br/>
<a href="https://github.com/doctrine/doctrine2/pull/1321" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1321</a></p>[DDC-3419] [GH-1196] Inherit indexes from mapped superclasshttp://www.doctrine-project.org/jira/browse/DDC-3419
Doctrine 2 - ORM<p>This issue is created automatically through a Github pull request on behalf of 51systems:</p>
<p>Url: <a href="https://github.com/doctrine/doctrine2/pull/1196" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1196</a></p>
<p>Message:</p>
<p>Patch to allow entities to inherit indexes from their mapped superclasses.</p>
<p>More info here:<br/>
<a href="http://www.doctrine-project.org/jira/browse/DDC-3418" class="external-link" rel="nofollow">http://www.doctrine-project.org/jira/browse/DDC-3418</a></p>DDC-3419[GH-1196] Inherit indexes from mapped superclassBugMajorResolvedFixedAllMarco PivettaDoctrine BotddlindexinheritancemappedsuperclassmappingThu, 27 Nov 2014 04:52:57 +0000Thu, 27 Nov 2014 18:13:43 +0000Thu, 27 Nov 2014 18:13:43 +00002.4.62.5Mapping Drivers01<p>A related Github Pull-Request <span class="error">&#91;GH-1196&#93;</span> was assigned:<br/>
<a href="https://github.com/doctrine/doctrine2/pull/1196" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1196</a></p><p>A related Github Pull-Request <span class="error">&#91;GH-1196&#93;</span> was closed:<br/>
<a href="https://github.com/doctrine/doctrine2/pull/1196" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1196</a></p>DuplicateDDC-3418[DDC-3418] Indexes not inherited from mapped superclasshttp://www.doctrine-project.org/jira/browse/DDC-3418
Doctrine 2 - ORM<p>Index definitions on mapped super classes are not inherited by their sub-classes.<br/>
I realize this makes the definition of the mapped super-class look a bit weird as it requires it to have a <tt>@Table</tt> element which isn't strictly valid since there is no corresponding table in the database.<br/>
However, it would be nice to set indices on the mapped superclass where the fields are actually defined as this increased comprehension and reduces maintenance.</p>DDC-3418Indexes not inherited from mapped superclassImprovementMinorResolvedFixedMarco PivettaDustin ThomsonddlindexinheritancemappedsuperclassmappingThu, 27 Nov 2014 04:43:41 +0000Thu, 27 Nov 2014 18:14:35 +0000Thu, 27 Nov 2014 18:14:35 +00002.4.62.5Mapping Drivers02<p>Handled in <a href="http://www.doctrine-project.org/jira/browse/DDC-3419" title="[GH-1196] Inherit indexes from mapped superclass" class="issue-link" data-issue-key="DDC-3419"><del>DDC-3419</del></a></p>DuplicateDDC-3419ReferenceOXM-2DDC-3273[DDC-3272] EntityGenerator writes 'MappedSuperClass' instead of 'MappedSuperclass'http://www.doctrine-project.org/jira/browse/DDC-3272
Doctrine 2 - ORM<p>In file doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php, method: generateEntityDocBlock at line: 826, we have </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">$lines[] = ' * @' . $<span class="code-keyword">this</span>-&gt;annotationsPrefix . 'MappedSuperClass';</pre>
</div></div>
<p>but we do NOT have an annotation in <tt>Doctrine\ORM\Mapping</tt> called <tt>'MappedSuperClass'</tt> but <tt>'MappedSuperclass</tt>. (Notice the lowercase "c"!).</p>
<p>When using the generator, this generates the mapped superclass with wrong annotation resulting in <blockquote><p>AnnotationException ::semanticalError ('The annotation "@Doctrine\ORM\Mapping\MappedSuperClass" in class Jab\Bundle\PlatformBundle\Entity\JabEntity does not exist, or could not be auto-loaded.')<br/>
in /home/data/WWW/localServer/test.bradipo/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php at line 706</p></blockquote></p>not relevantDDC-3272EntityGenerator writes 'MappedSuperClass' instead of 'MappedSuperclass'BugMinorResolvedFixedAllSteve MüllerJakab Adam BalazsmappedsuperclassormtoolsTue, 26 Aug 2014 09:30:23 +0000Wed, 10 Sep 2014 16:29:13 +0000Wed, 10 Sep 2014 16:29:13 +00002.4.42.5Tools03<p>Marked as minor issue: the entity generator is not the primary focus of the project.</p><p>Provided a hotfix at <a href="https://github.com/doctrine/doctrine2/pull/1132" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1132</a></p><p>Fixed in commit: <a href="https://github.com/doctrine/doctrine2/commit/b249aa9f652efdd36992ea542ccbd8e82f1b75be" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/commit/b249aa9f652efdd36992ea542ccbd8e82f1b75be</a></p>DependencyDDC-3302[DDC-3061] [GH-996] [DDC-3027] Embedded in MappedSuperclasshttp://www.doctrine-project.org/jira/browse/DDC-3061
Doctrine 2 - ORM<p>This issue is created automatically through a Github pull request on behalf of coma:</p>
<p>Url: <a href="https://github.com/doctrine/doctrine2/pull/996" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/996</a></p>
<p>Message:</p>
<p>The fields from the MappedSuperclass embedded properties are getting mapped directly into the MappedSuperclass fields causing the error.</p>
<p><a href="http://www.doctrine-project.org/jira/browse/DDC-3027" class="external-link" rel="nofollow">http://www.doctrine-project.org/jira/browse/DDC-3027</a></p>DDC-3061[GH-996] [DDC-3027] Embedded in MappedSuperclassBugMinorResolvedFixedAllGuilherme BlancoDoctrine BotmappedsuperclassmappingMon, 31 Mar 2014 10:36:43 +0000Thu, 15 May 2014 02:37:41 +0000Thu, 15 May 2014 02:37:41 +00002.5ORM01<p>A related Github Pull-Request <span class="error">&#91;GH-996&#93;</span> was closed:<br/>
<a href="https://github.com/doctrine/doctrine2/pull/996" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/996</a></p><p>A related Github Pull-Request <span class="error">&#91;GH-1023&#93;</span> was closed:<br/>
<a href="https://github.com/doctrine/doctrine2/pull/1023" class="external-link" rel="nofollow">https://github.com/doctrine/doctrine2/pull/1023</a></p>[DDC-2436] Inheritance on mappedSuperClasshttp://www.doctrine-project.org/jira/browse/DDC-2436
Doctrine 2 - ORM<p>Sometimes is necessary some associations(many to many) in the mappedSuperClass. This associations should not be lost (inversedBy side and mappedBy ). The only one way to get this, was to implement an abstract class as Single Inheritance Table and then the mappedSuperClass inherit of this. But this is not optimum, because we are losing the OOP, creating classes which should not exist.</p>
<p>I realized of this when i was creating my bundle to be used for some projects, but I needed each project could extends from my class and add some properties or methods according their needs.</p>
<p>This is the link where you can see more details of this:</p>
<p><a href="http://stackoverflow.com/questions/16405556/mapped-super-class-symfony2-2" class="external-link" rel="nofollow">http://stackoverflow.com/questions/16405556/mapped-super-class-symfony2-2</a></p>
<p>Thanks for your attention.</p>DDC-2436Inheritance on mappedSuperClassImprovementMajorResolvedInvalidAllMarco PivettaPetter CastromappedsuperclassWed, 8 May 2013 21:25:43 +0000Fri, 10 May 2013 16:55:33 +0000Fri, 10 May 2013 01:12:25 +0000ORM02<p>Mapped superclasses cannot be referenced as they are only meant to provide some simplification by allowing inherited mappings in child classes.</p>
<p>If you want to enforce some kind of association in third party libraries, you can define interfaces and reference those: then, with a listener (during the onLoadMetadata event), replace the interfaces in mappings with (configured) concrete class names.</p><p>I did it, and everything worked perfectly. However, is there a way to dynamically change the "resolve_target_entities" inside my LoadClassMetadata or inside my php code?. <br/>
I would like the user makes this configurations with params from my bundle. In background, my bundle will configure these params for doctrine.<br/>
Could i do that?</p>
<p>Thanks again for your attention.</p><p>I was thinking in duplicate some code of yours. Exactly this one:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
$def = $container-&gt;findDefinition('doctrine.orm.listeners.resolve_target_entity');
foreach ($config['resolve_target_entities'] as $name =&gt; $implementation) {
$def-&gt;addMethodCall('addResolveTargetEntity', array(
$name, $implementation, array()
));
}
</pre>
</div></div><p>That's exactly how this has to be done.</p><p>I did but there is a problem.... The service doctrine.orm.listeners.resolve_target_entity is not public. So i can't use it in my bundle. I wouldn't like to duplicate all code from this Service. How could I do?</p><p>That's an issue for the DoctrineBundle, not for the ORM.</p><p>Ok thanks a lot for your help. I will redirect my question to them.</p>[DDC-2157] @HasLifecycleCallbacks does not fire events when set on @MappedSuperclasshttp://www.doctrine-project.org/jira/browse/DDC-2157
Doctrine 2 - ORM<p>I am unable to fire any of the "HasLifecycleCallbacks" when defined on a MappedSuperclass... (neither PreUpdate, PostUpdate,PrePersist, PostPersist and others)</p>
<p>I have even tried to put @ORM\HasLifecycleCallbacks on the child class with onPostRemove() on mapped =&gt; not working anymore</p>
<p>It only works when i put @ORM\HasLifecycleCallbacks and onPostRemove() both in child class "MyMappedTask"...</p>
<p>Is this a bug ..?</p>
<p>To reproduce :</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;?php
namespace MyProject\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\MappedSuperclass
* @ORM\HasLifecycleCallbacks
*/
class MyMappedTask
{
/**
* @ORM\PreRemove
* @ORM\PostRemove
* @ORM\PreUpdate
* @ORM\PostUpdate
*/
<span class="code-keyword">public</span> function onPostRemove()
{
echo <span class="code-quote">"here is never reached !"</span>;
}
}
/**
* @ORM\Entity(repositoryClass=<span class="code-quote">"MyProject\Repository\MyTaskRepository"</span>)
* @ORM\Table()
*/
class MyTask <span class="code-keyword">extends</span> MyMappedTask
{
}
</pre>
</div></div>Windows 7 x64 / Apache 2.4.2 / MySQL server 5.1.62DDC-2157@HasLifecycleCallbacks does not fire events when set on @MappedSuperclassBugCriticalResolvedInvalidAllBenjamin EberleiFredericHasLifecycleCallbacksMappedSuperclassTue, 20 Nov 2012 13:59:52 +0000Tue, 27 Nov 2012 21:29:48 +0000Tue, 27 Nov 2012 21:29:48 +00002.2.3ORM03<p>code format</p><p>Hi Frederic,</p>
<p>It failed for all events or just for @PostRemove ?</p>
<p>Could you try to add a failing test case ?</p>
<p>Cheers</p><p>Hi Fabio,</p>
<p>1) Thank you for the "code" tag, i didn't know to do <img class="emoticon" src="http://www.doctrine-project.org/jira/images/icons/emoticons/wink.gif" height="16" width="16" align="absmiddle" alt="" border="0"/></p>
<p>2) Is fails with all the Annotations "Pre/Post*" ...</p>
<p>Did you try this test case ?</p>
<p>Thank you</p><p>Hi Frederic,</p>
<p>Can't reproduce.. <br/>
Could you try to change the attached test case and make it fails ?</p>
<p>Cheers</p><p>Hi Fabio,</p>
<p>Thank you for the test case, it is OK !</p>
<p>I found what the problem was :<br/>
I use Symfony2 and i have one bundle with the @MappedSuperclass entity and its callbacks (@HasLifecycleCallbacks), and another bundle with the child class (@Entity/@Table).<br/>
In that case, you must register the 2 bundles on the mappings (config.yml) otherwise it fails. <br/>
(I only registered the bundle which contains the child class but was not enough for Doctrine to understand...) </p>
<p>I don't know if it is a bug on Symfony2, not well documented in this case...</p>
<p>Thank you for all</p>