[FLOW3-general] Annotation syntax for table indexes
Thomas Mammitzsch
thomas at visualworx.de
Mon Dec 10 17:31:02 CET 2012
Hi Regine,
sorry for digging out this old post, but this is what i need. I don't
get it work - maybe a bit longer example would help?
it tried the annotation, both, on top of the class (below @Flow\Entity
and on top of the single property i want my index on.
i assume the first one makes more sense because an index can rely on
more than one column. So:
/**
* A myobject
*
* @Flow\Entity
* @ORM\table(indexes={ORM\index(name="<ort>",columns={"<ort>"})})*
*/
class Myobject {
...
}
gets me this excepiton:
[Semantical Error] The annotation "@Doctrine\ORM\Mapping\table" in
class
Acme\Demo\Model\Myobject does not exist, or
could
not be auto-loaded.
regards, Thomas
On 09.01.2012 02:36, Regine Rosewich wrote:
> Hi thomas,
>
> the correct syntax is:
>
> 1. for unique constraints
>
> @ORM\Table(uniqueConstraints={ORM\UniqueConstraint(name="<uniqeConstraintNam
> e>",columns={"<col1>","<col2>","<col..n>"})})
>
> 2. for indexes
>
> @ORM\Table(indexes={ORM\index(name="<indexName>",columns={"<col1>","<col2>",
> "<col..n>"})})
>
> 3. Combination of both
>
> @ORM\Table(uniqueConstraints={ORM\UniqueConstraint(name="<uniqeConstraintNam
> e>",columns={"<col1>","<col2>","<col..n>"})},
> indexes={ORM\index(name="<indexName>",columns={"<col1>","<col2>","<col..n>"}
> )})
>
> Hope it helps
>
> Regine
More information about the FLOW3-general
mailing list