On 2009-09-30 16.22, Alex Shneyderman wrote:
             uow = moduleInstance.unitOfWorkFactory().newUnitOfWork();

             account = uow.newEntityntity( Account.class, newId );

             account.balance().set( new BigDecimal( "323423.87" ) );

             account.name().set( "Big account." );

             uow.apply();

throws an exception on line

account = uow.newEntityntity( Account.class, newId );

as balance is not there. But I do not see an obvious way to provide
it. If I make balance optional everything work fine.

What do I need to do here, aside from making balance optional?

This is exactly what EntityBuilders are for. do uow.newEntityBuilder() instead and then use instance() to set the initial value before calling builder.newInstance().

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to