Hi,
In method updateStage I'm trying to save only one object from list created using @Factory method, but it always saves all elements from list. How can I make it work?
@Stateless
@Name("stageBean")
public class StagesBean implements Stages
{
@In(create=true)
@Out(required=false)
StagesSchedule stage;
@DataModel
private List<StagesSchedule> stages;
@DataModelSelection
private StagesSchedule selectedStage;
@PersistenceContext
EntityManager em;
public void updateStage()
{
StagesSchedule s = stages.get(0);
em.merge(s);
}
@Factory("stages")
public void findStages(){
stages = em.createQuery("select s from StagesSchedule s order by s.name").getResultList();
}
@Remove
public void destroy() {}
}
I'm sorry. I found out that my colleague asked for that already and gor reply.