@Id
For entities that have multiple identifier columns each column has to be marked with @Id. |
@Index
name str |
columns [] |
Columns |
options [] |
where |
@Column
type str |
name str |
length int |
options [] |
default, unsigned, fixed ... |
unique bool |
nullable bool |
columnDefinition str |
DQL definition |
precision int |
scale int |
"precision" and "scale" are only for decimal columns.
@Cache
usage ch |
see choices below |
region str |
READ_ONLY, READ_WRITE,NONSTRICT_READ_WRITE
@ChangeTrackingPolicy
/**
* @Entity
* @ChangeTrackingPolicy("DEFERRED_IMPLICIT")
* @ChangeTrackingPolicy("DEFERRED_EXPLICIT")
* @ChangeTrackingPolicy("NOTIFY")
*/
class User {}
|
@Entity
repositoryClass (string) |
readOnly (boolean) |
@EntityResult
entityClass (string) |
fields (array|FieldResult) |
discriminatorColumn (string) |
@FieldResult
name (string) |
column (string) |
@GeneratedValue
strategy (choice : AUTO, SEQUENCE, TABLE, IDENTITY, UUID, CUSTOM or NONE) |
|
|
@OneToOne
targetEntity (string) |
cascade (array|cascades actions) |
fetch (choice: LAZY, EAGER) |
orphanRemoval (boolean) |
inversedBy (string) |
@ManyToOne
targetEntity (string) |
cascade (array|cascades actions) |
fetch (choice: LAZY, EAGER) |
inversedBy (string) |
@OneToMany
targetEntity (string) |
cascade (array|cascades actions) |
orphanRemoval (boolean) |
mappedBy (string) |
fetch (choice: LAZY, EXTRA_LAZY, EAGER) |
indexBy (string) |
@ManyToMany
targetEntity (string) |
mappedBy (string) |
inversedBy (string) |
cascade (array|cascades actions) |
fetch (choice: LAZY, EXTRA_LAZY, EAGER) |
indexBy (string) |
@OrderBy
/**
* @ManyToMany(targetEntity="Group")
* @OrderBy({"name" = "ASC"})
*/
private $groups;
|
See @ManyToMany or @OneToMany.
@JoinColumn
name (string) |
referencedColumnName (string) |
unique (boolean) |
nullable (bool) |
onDelete (array|cascades actions) |
columnDefinition (string : DQL definition) |
See @ManyToOne and @OneToOne.
@JoinTable
name (string) |
joinColumns (array|@JoinColumn) |
inverseJoinColumns (array|@JoinColumn) |
|
|
@SequenceGenerator
sequenceName (string) |
allocationSize (integer) |
initialValue (integer) |
@SqlResultSetMapping
name (string) |
entities (array|@EntityResult) |
columns (array|@ColumnResult) |
@Table
name (string) |
indexes (array|@Index) |
uniqueConstraints (array|@UniqueConstraint) |
schema (string) |
@UniqueConstraint
name (string) |
columns (array|column) |
options (array|: where) |
@MappedSuperclass
repositoryClass (string) |
@NamedNativeQuery
name (string) |
query (string) |
resultClass (string) |
resultSetMapping (string|SqlResultSetMapping) |
@Version
It only works on integer or datetime @Columns. |
@InheritanceType
/**
* @Entity
* @InheritanceType("SINGLE_TABLE")
...
/**
* @Entity
* @InheritanceType("JOINED")
|
See @DiscriminatorMap and @DiscriminatorColumn.
@DiscriminatorMap
/**
* @Entity
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"person" = "Person", "employee" = "Employee"})
*/
class Person {}
|
@DiscriminatorColumn
name (string) |
type (string) |
length (int) |
@HasLifecycleCallbacks
See @PostLoad, @PrePersist, @PostPersist, @PreRemove, @PostRemove, @PreUpdate or @PostUpdate. |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets