Annotation Interface ViewEntity


@Target(TYPE) @Retention(RUNTIME) @Documented public @interface ViewEntity
The view entities can be mapped to real entities, that represent a database table, and can be persisted. The view can't be persisted to the database, however, with this solution, the views can be saved and deleted. The view entity will be mapped to the entity, and it must have this annotation assigned to it. This annotation is used to specify where the MappedField annotations are in the view entity. If no MappedField annotations are found in the view entity, then a AnnotationFormatError will be thrown during the processing. The MappedField annotations concretely specify, which view field value will be set to which database field. The JpaDaoAPI observes and handles the saving and deleting, according to these annotations. During the query these annotations aren't used, since the view itself can be queried. The MappedField annotation can be placed on a field multiple times, since it is possible, that a view entity field value has to be set to multiple entity fields as well. It is also possible, that a view entity field value needs to be saved to multiple annotations. The annotation must be placed on the class level, not on the field level.
Since:
4.0
Author:
JBStrap
See Also: