Hmm, presumably is the Shopping cart that has the instance Id that you
quoted?

Perhaps you could show us the definition on that class too?

---
Unrelated to your original query, now that you should be able to inject
your AytoNumberRepository. Just ensure that it is annotated with
@DomainService and is in a package specified by your AppManifest.
On 19 Feb 2016 19:08, "Arturo Ulises Castañeda Estrada" <
arturo.castan...@sisorg.com.mx> wrote:

> 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 <d...@haywood-associates.co.uk>
> 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 <
> arturo.castan...@sisorg.com.mx> 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