As I understand the persist is after the return obj.
 
@DomainService(repositoryFor = ShoppingCart.class,
        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)

public class ShoppingCartRepository {

    //region > newShoppingCart (action)
    public static class CreateDomainEvent extends 
ActionDomainEvent<ShoppingCartRepository> {
        public CreateDomainEvent(final ShoppingCartRepository source, final 
Identifier identifier, final Object... arguments) {
            super(source, identifier, arguments);
        }
    }

    @Action(
            domainEvent = CreateDomainEvent.class
    )
    @MemberOrder(name="shoppingCarts",sequence = "1")
    public ShoppingCart newShoppingCart(
            //final @ParameterLayout(named="Shopping Cart Id") Long 
shoppingCartId,
            final @ParameterLayout(named="Customer Subscription") 
CustomerSubscription customerSubscription
    )
    {
        final ShoppingCart obj = 
container.newTransientInstance(ShoppingCart.class);

        //Obtener Folio
        autoNumberRepository = new AutoNumberRepository();
        autoNumberRepository.setContainer(container);
        Long shoppingCartId =  autoNumberRepository.nextAutoNumber("SHOPPING 
CART ID" , null);
        obj.setShoppingCartId(shoppingCartId);
        obj.setCustomerSubscription(customerSubscription);
        obj.setCreationTime(clockService.nowAsDateTime());
        obj.setStatus(ShoppingCartStatus.SHOPPING);
        container.persistIfNotAlready(obj);
        return obj;
    }
    //endregion
________________________________________
De: Dan Haywood <[email protected]>
Enviado: viernes, 19 de febrero de 2016 12:52 p. m.
Para: users
Asunto: Re: instanceId

I suspect that's actually the instanceId of a domain object that's neither
a view model nor a persistent entity, ie is a "transient" entity (not yet
persisted to the DB).

The RO viewer doesn't support such things (in fact, nor does the Wicket
viewer anymore; they are a legacy of an earlier time).  The fix, I expect,
will be to make sure the entity is a properly annotated view model.

HTH
Dan




On 19 February 2016 at 18:50, Arturo Ulises Castañeda Estrada <
[email protected]> wrote:

> Hi Dan, I have a problem, when i insert data, I get return the resource
> and i get all JSON, I need the instanceId but for any reason the instanceId
> it's encrypted.
>
>
> "instanceId" : "ec263491-bb79-4a11-a205-f1dfd2840f36"
>
>
>

Reply via email to