tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr." <smithh032...@gmail.com>
Subject Re: question around entityManager.flush
Date Wed, 21 May 2014 19:52:30 GMT
On Wed, May 21, 2014 at 3:42 PM, Romain Manni-Bucau
<rmannibucau@gmail.com>wrote:

> what I say is you can do eveything in a single method method.


Sounds like you are recommending something similar to the following:

1. @RequestScoped bean to get data to display in UI layer to enduser

2. If user modifies data, and data is submitted from client/UI to
server/bean (@Session/ViewScoped/RequestScoped), then pass modified @Entity
from Session/View/RequestScoped bean to @Stateless @EJB, and

3. @Stateless @EJB method(@Entity entity) does the following:

a. find entity via SELECT or find
b. foundEntity.property = entity.property
c. repeat step 'b.' above for all properties
d. edit(foundEntity)

are you recommending something like this (above)?




> The fact you need flush means your operation need a state provided by the
> database (@GeneratedValue?).
>
>
public class AuditTrail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "AUDIT_TRAIL_ID")
    private Integer auditTrailId;

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message