camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "richie.riviere@gmail.com" <richie.rivi...@gmail.com>
Subject Re: JPA @Consumed
Date Thu, 12 Dec 2013 04:41:21 GMT
Abother question about @Consumed. Using the strategy as described in my last
post, what I am doing in selecting an ImportPayloadEntity, splitting this
entity which has a list of ItemEntities into individual ItemEntity objects
and processing each ItemEntity object.

During the processing of each ItemEntity object I call...

        item.setWorkingProcessedInd("Y");
        item.setWorkingProcessedDatetime(new Date());  

Then once the route is finish in the ImportPayloadEntity bean I do something
like this...

	@Consumed
	public void markConsumed() {
		boolean errors = false;
    	Collection<ItemEntity> itemEntities = this.getItems();
    	for (ItemEntity itemEntity: itemEntities){
    		if (itemEntity.getProcessedInd().equals(DaoConstants.ERROR)){
    			errors = true;
    		}
    		itemEntity.setProcessedInd(itemEntity.getWorkingProcessedInd());
    	
itemEntity.setProcessedDatetime(itemEntity.getWorkingProcessedDatetime());
    	}
    	this.setProcessedInd(errors ? DaoConstants.ERROR :
DaoConstants.PROCESSED);
		this.setProcessedDatetime(new Date());
	}


This leads to the ImportPayloadEntity record in the db being updated. But
where this strategy fails is that when i do...
    		itemEntity.setProcessedInd(itemEntity.getWorkingProcessedInd());
    	
itemEntity.setProcessedDatetime(itemEntity.getWorkingProcessedDatetime());

itemEntity.getWorkingProcessedInd() and
itemEntity.getWorkingProcessedDatetime() are both null. In other words it
has not remembered the values I set on the objects in my route.

It seems somewhere along the line my ItemEntity objects are not being passed
by reference. Am I right?
What would be a good way to fix this?

thanks






--
View this message in context: http://camel.465427.n5.nabble.com/JPA-Consumed-tp5744640p5744651.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message