Skip to content

List of all Annotations and their Parameters

sweiguny edited this page Nov 21, 2014 · 10 revisions

Here is a complete list of all annotations and their parameters that can be parsed by PPA.

The order of the annotations conforms their relevance. That means, that annotations that are often used and infuse the entire relational mapping are listed first.

Note:

  • Many parameters have a default value. This value is shortly named 'default'. The default is used, when the parameter is omitted.
  • Some defaults take effect even when the entire annotation is omitted. When that's the case the parameter is marked with !.
  • Parameters without default cannot be omitted.

If you need to know the syntax specification please look here.


@table

Gives the opportunity to parameterize a class with table specific options. This annotation is not intended to mark an entity for data mapping. To enable data mapping for an entity it must extend the \PPA\core\Entity class.

Parameters:

  • name !
    • Description: The name of the database table the class is mapped to.
    • Default: Short name of the class.
    • Note: The value (no matter whether assigned or default) is always interpreted lower case.

@column

Marks a property for mapping to a column. PPA only recognizes a property for mapping if this annotation is made.

Parameters:

  • name
    • Description: The name of the column the property is mapped to.
    • Default: Name of the property.
    • Note: The value (no matter whether assigned or default) is always interpreted lower case.

@id

Marks a property to be the primary. Can only be used in combination with @column.


@oneToOne, @oneToMany, @manyToMany

Parameters:

  • mappedBy
    • Description: The fully qualified classname of the related entity. Is case sensitive.
  • fetch
    • Description: The fetch type. Can be 'eager' or 'lazy'.
    • Default: 'lazy'
  • cascade
    • Description: The cascade type. Can be 'all', 'none', 'remove' or 'persist'.
    • Default: The value of the OPTION_DEFAULT_CASCADE_TYPE, if set on initialisation. If not, its 'none'.

@joinTable

Additional relation information. Is needed and only available in combination with @oneToMany and @manyToMany

Parameters:

  • name
    • Description: The table name of the associative table.
    • Note: The value (no matter whether assigned or default) is always interpreted lower case. Only used for @manyToMany relations.
  • column
    • Description: The column name of the associative table that references to to the primary of the actual entity.
    • Note: The value (no matter whether assigned or default) is always interpreted lower case. Only used for @manyToMany relations.
  • x_column
    • Description: The column name of the related/associative table that references to to the primary of the related entity.
    • Note: The value (no matter whether assigned or default) is always interpreted lower case. Used for both relations (@oneToMany and @manyToMany).
Clone this wiki locally