[
https://issues.apache.org/jira/browse/LABS-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12733927#action_12733927
]
Simone Gianni commented on LABS-389:
------------------------------------
Two new aspects will inject default id and version to @Entity beans not
providing them either as an annotated getter or annotated field.
Two annotations (@NoId and @NoVersion) prevents this injection.
Injection is done using property style, that is injecting the field and the
getter/setter pair, having the getter annotated. This could cause problem is
field style is used, cause JPA does not support mixed style. In that case, the
aspect can be extended to annotate fields instead of getters guessing on how
other fields or getters has been annotated.
The id setter is not public.
The injected @Id is also annotated @GeneratedValue, cause this is the most
common case.
> [database] ITD with id and version for beans
> --------------------------------------------
>
> Key: LABS-389
> URL: https://issues.apache.org/jira/browse/LABS-389
> Project: Labs
> Issue Type: New Feature
> Components: Magma
> Affects Versions: Current
> Reporter: Simone Gianni
> Assignee: Simone Gianni
> Fix For: Current
>
>
> When a Magma managed bean is declared @Entity, an ITD should add the id and
> the version fields by default.
> Since there could be the possibility of using custom primary keys or wanting
> no version field (why?), then a way to customize it should be added :
> - If there is already an @Id annotated field/getter, don't add the field
> - Same if there is already a @Version
> - Check also for other possible JPA alternatives
> - Expecially for subclasses of existing entities
> - Provide annotations to manually avoid the ITD
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]