[OXM-3] Indexes not inherited from mapped superclass Created: 27/Nov/14  Updated: 27/Nov/14  Resolved: 27/Nov/14

Status: Resolved
Project: Doctrine Object-XML Mapper
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Dustin Thomson Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None


 Description   

Index definitions on mapped super classes are not inherited by their sub-classes.

I realize this makes the definition of the mapped super-class look a bit weird as it requires it to have a @Table element which isn't strictly valid since there is no corresponding table in the database.

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.



 Comments   
Comment by Dustin Thomson [ 27/Nov/14 ]

Sorry, this should have been created under ORM project
(DDC-3418)

Comment by Doctrine Bot [ 27/Nov/14 ]

A related Github Pull-Request [GH-1196] was assigned:
https://github.com/doctrine/doctrine2/pull/1196

Comment by Doctrine Bot [ 27/Nov/14 ]

A related Github Pull-Request [GH-1196] was closed:
https://github.com/doctrine/doctrine2/pull/1196





[OXM-2] Mapped-superclass, indexes not gathered Created: 29/Mar/12  Updated: 27/Nov/14

Status: Open
Project: Doctrine Object-XML Mapper
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Lazar Otasevic Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 3
Labels: None
Environment:

win7 xamp mysql


Issue Links:
Reference
is referenced by DDC-3418 Indexes not inherited from mapped sup... Resolved

 Description   

GenericPositionPair XML:
<mapped-superclass name="GenericPositionPair">
<indexes>
<index columns="position" />
</indexes>
<field name="position" type="integer" column="position" />
</mapped-superclass>

GenericPrimaryPositionPair XML:
<mapped-superclass name="GenericPrimaryPositionPair">
<indexes>
<index columns="isPrimary" />
</indexes>
<field name="isPrimary" type="boolean" column="isPrimary" />
</mapped-superclass>

PrimaryPositionPair XML:
<entity name="PrimaryPositionPair" table="PrimaryPositionPair">
<id name="first" type="integer" column="first_id" association-key="true" />
<id name="second" type="integer" column="second_id" association-key="true" />
<many-to-one field="first" target-entity="First">
<join-column name="first_id" referenced-column-name="id" />
</many-to-one>
<many-to-one field="second" target-entity="Second">
<join-column name="second_id" referenced-column-name="id" />
</many-to-one>
</entity>

PHP:
PrimaryPositionPair exteds GenericPrimaryPositionPair
GenericPrimaryPositionPair extends GenericPositionPair

Finally - the resulting SQL statement contains no idexes on position and isPrimary fields.

Suggestion - wouldn't it be easier to just include attribute index="true" instead od <indexes> tag, since attribute unique="true" already works.



 Comments   
Comment by Lazar Otasevic [ 29/Mar/12 ]

As far as i can see, the shcema-tool gathers only fields and relations from xml and not <indexes> WHY?
Since it fetches unique attribute from a field and accordingly adds an unique index to the final statement, wouldnt it be natural to also gether indexes?
My suggestion remains about index attribute of a field.

Comment by Lazar Otasevic [ 25/Apr/12 ]

Anybody?

Comment by Lazar Otasevic [ 18/May/12 ]

HELLO?





[OXM-1] Composite string key ignoring the length attribute Created: 29/Mar/12  Updated: 29/Mar/12

Status: Open
Project: Doctrine Object-XML Mapper
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Lazar Otasevic Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

win7 xamp mysql



 Description   

Hello, I have the following XML mapping

<entity name="Auth" table="Auth">
<id name="itemname" column="itemname" type="string" length="64" />
<id name="userid" column="userid" type="string" length="64" />
<field name="bizrule" column="bizrule" type="text" nullable="true" />
<field name="data" column="data" type="text" nullable="true" />
</entity>

And the sql output is:

CREATE TABLE Auth (itemname VARCHAR(255) NOT NULL, userid VARCHAR(255) NOT NULL, bizrule LONGTEXT DEFAULT NULL, data LONGTEXT DEFAULT NULL, PRIMARY KEY(itemname, userid)) ENGINE ...

So, the length atrtibute is always ignored. In MyIsam it breaks the script because of the maximum key limit






Generated at Sat Nov 29 10:06:04 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.