Entities
Learn the basics of modeling ORM entities
A persistent entity is a CFML component that is marked as a database entity via the persistent
annotation upon the component definition:
By default, the entity name will be the CFC file name - minus the file extension, of course. We can modify the entity name via the entityname
annotation:
And the table name via the table
annotation:
Here's the full list of available annotations for a persistent component:
Attribute | Type | Default | Description |
---|---|---|---|
|
|
| Mark this component as an ORM entity |
|
| Set a custom entity name which is different than the CFC name | |
|
| Specify the database table name | |
|
| Specify the database schema name. | |
|
| Specify the database catalog name. | |
| Specifies whether INSERT SQL is to be generated at runtime. Only those columns whose values are not null are included in the SQL. | ||
|
|
| Specifies whether INSERT SQL is to be generated at runtime. Only those columns whose values are not null are included in the SQL. |
|
|
| Specifies whether UPDATE SQL is to be generated at runtime. Only those columns whose values are not null are included in the SQL. |
|
|
| Specify whether table is readonly or not |
|
| Specify whether Hibernate should never perform an SQL UPDATE unless it is certain that an object is actually modified. In cases when a transient object is associated with a new session using update(), Hibernate performs an extra SQL SELECT to determine if an UPDATE is actually required. | |
|
| Determines the locking strategy. It can be any one of: | |
|
| An integer value that specifies the number of records to be retrieved at a single instance. | |
|
|
| Whether loading is to be done lazily or not. |
|
| Specify the row id | |
|
| Use this attribute to define the discriminator column to be used in inheritance mapping | |
|
| Use this attribute to define the discriminator value to be used in inheritance mapping | |
|
| Define a join column for inheritance mapping | |
|
| Marks CFC as embedded, used when a CFC has an embedded object which also needs to be persisted along with the parent's data | |
|
| Specify the caching strategy to be used for caching this component's data in the secondary cache: | |
|
| Specify the name of the secondary cache | |
|
|
| Specifies whether the generated Hibernate mapping file has to be saved to disk. If you set the value to true, the Hibernate mapping XML file is saved as |
|
| Name a specific datasource to persist this entity to. |
Last updated