On Fri, 24 Jun 2011 15:48:08 -0300, George Christman
<gchrist...@cardaddy.com> wrote:
List<Funding> _fundings =
session.createCriteria(Funding.class).add(Restrictions.eq("purchaseRequest.id",
purchaseRequest.getId())).list();
NEW_FUNDING.setName(NEW_FUNDING_NAME);
NEW_FUNDING.setId(OTHER_ID);
_fundings.add(OTHER);
You're setting the fields of NEW_FUNDING and using OTHER. ;)
OTHER.setName(NEW_FUNDING_NAME);
OTHER.setId(OTHER_ID);
_fundings.add(OTHER);
Also, I need to validate that the other object isn't being selected and
committed to the db. I wrote this code within the onValidate method
for (LineItem _lineItem : purchaseRequest.getLineItems()) {
for(LineItemFunding _lineItemFunding :
_lineItem.getLineItemFundings()) {
if(lineItemFunding.getFunding().getId() == -1) {
_lineItem.getLineItemFundings().remove(_lineItemFunding);
}
}
}
and I get the following error
java.util.ConcurrentModificationException
Copy the list to another list instance and work on the copy.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org