i added event handlers for handling updates of my table, and it seems to work fine but updated values are not correct here for a row which is related to user table in “one to many” relation
@Async
@Override
public void afterUpdate( RunnerContext context, PEvents pevents, ExecutionResult<PEvents> result ) throws Exception
{
// add your code here
System.out.println(“afterUpdate :”+pevents.getUpvotes().size()); // always returns 1 but in server upvotes Row have more than 1 related users
}
@Async
@Override
public void beforeUpdate( RunnerContext context, PEvents pevents ) throws Exception
{
// add your code here
voteCount = pevents.getUpvotes().size();
System.out.println(“beforeUpdate :”+pevents.getUpvotes().size()); // always returns 1 but in server upvotes Row have more than 1 related users
}
why “pevents.getUpvotes().size()” not returning the correct value ??
UPDATE
after selecting “AutoLoad” from table’s row its returning correct value of “pevents.getUpvotes().size()” , still i have a problem here :
the value of “pevents.getUpvotes().size()” is same on beforeUpdate and afterUpdate ?? why is it happening ???