I am using primeface schedule component and having an issue onEventMove event. My event handler method is as the following:
public void onEventMove(ScheduleEntryMoveEvent event) {
/* I put the id of my object as data of schedule event
* while I constructed event model.
*/
String id = (String) event.getScheduleEvent().getData();
/* And when the move event occure, find my object by
* using the data of the moved event.
*/
MyObject myObject = myObjectManager.findMyObject(id);
/* MyObject also have two attributes, startDate and endDate
*/
Date startTime = myObject.getStartDate();
Date endTime = myObject.getEndDate();
/* I print out startDate and endDate of MyObject and
* new start date and end date of moved event
*/
System.out.println(startTime);
System.out.println(endTime);
System.out.println(event.getScheduleEvent().getStartDate());
System.out.println(event.getScheduleEvent().getEndDate());
}
My issue here is that the output are being same. I mean the output of the statement:
System.out.println(startTime);
is same with the output of
System.out.println(event.getScheduleEvent().getStartDate());
and also the output of the statement
System.out.println(endTime);
is being same with
System.out.println(event.getScheduleEvent().getEndDate());
Can anybody suggest me what I am doing wrong please?
myObjectManager is an instance of EJB stateless session bean and the souce code of myObjectManager.findMyObject(id) is as following:
public MyObject findMyObject(String id) {
return myObjectEAO.find(id);
}
myObjectEAO is also an instance of EJB stateless session bean and the source code of myObjectEAO.find(id) is as following:
public MyObject find(String id) {
// em, here, is an instance of entity manager
return em.find(MyObject.class, id);
}