>From memory, I think the IsisJdoSupport service has some flush or refresh methods; I forget the details.
Dan Sorry to be brief, sent from my phone On 29 Mar 2014 11:15, "GESCONSULTOR" <[email protected]> wrote: > > > Objects are only in transient state while being configured on the "create" > action (factory method) that usually ends with a "persist(entity)". > > We've overridden the persist method In our base AbstractService used as > the parent for repositories to always do a flush(). > > Perhaps bulk inserts would be slower but it's completely preferred to not > having the other side's collection updated. > > As updates are managed by Isis the previous one (entity created on > transient state and before executing a persist that always includes a > flush) is the only possible case I think where the state on bidirectional > relationships would be inconsistent. And that's ok as it's when your > initializing its state. > > HTH, > > Oscar > > > > > > El 29/03/2014, a las 04:27, John Lafer <[email protected]> escribió: > > > > Thanks Dan, Jeroen and Oscar. > > > > Using your input I have the dialogue window returning as required. > > > > However, I do have a nagging concern about NOT eagerly implementing the > mutual registration pattern in my code. I guess the JDO layer is using the > annotations and the reference from the child to the parent in order to > persist the bi-directional relationship. And at some point it fixes up all > references between in-memory objects. That's fine but it feels risky to > operate, prior to the persistence operation (flush?), with an object graph > that is not quite complete. Specifically, the parent's collection of child > objects does not include the newly added child until the JDO layer does > it's thing, if I understand it right. I suppose there are some conventions > on how to work with this "transient" data safely, but I don't have that > figured out yet. > > > > I wouldn't be concerned yet except it seems that by removing the mutual > registration boilerplate code, some of my fixtures are now breaking with > null pointer exceptions. I've probably done something else wrong and need > to debug this, but it does seem like a suspicious coincidence. > > > > Net: I need to keep researching and playing with this I think. > > > > John > > > > > > ________________________________ > > From: Dan Haywood <[email protected]> > > To: users <[email protected]> > > Sent: Thursday, March 27, 2014 2:15 AM > > Subject: Re: Returning from an Action to the Action-owning Entity > > > > > > > > Yeah, just updating that page [3] now to point those out [4] > > > > > > [4] http://isis.apache.org/intro/resources/editor-templates.html > > > > > > > > > > On 27 March 2014 09:13, GESCONSULTOR - Óscar Bou <[email protected]> > wrote: > > > > Hi John, > >> > >> > >> Simply to notice, if you're interested also on alternative > implementations of the 1-n relationship (such as with Join tables), or m-n > relationships, or 1-1 relationships (both bidirectional and unidirectional) > the Eclipse Isis Templates have different examples, all them beginning with > the "isjd" prefix. > >> > >> > >> HTH, > >> > >> > >> Oscar > >> > >> > >> [1] http://isis.apache.org/intro/resources/editor-templates.html > >> > >> > >> > >> El 27/03/2014, a las 10:08, Dan Haywood <[email protected]> > escribió: > >> > >> > >> > >> Hi John, welcome. > >>> > >>> As Jeroen says, the way to return to the original object is to "return > >>> this" rather than void. > >>> > >>> We actually had a discussion about this a little while back on the > mailing > >>> list [1], and I raised a ticket then [2] as a placeholder. > >>> > >>> ~~~ > >>> Also, you mentioned you've implemented the mutual registration > pattern. If > >>> you're using the JDO objectstore (you probably are), then you probably > >>> don't need to do this if you mark up the relationship as bidirectional > [3]. > >>> > >>> Cheers > >>> Dan > >>> > >>> > >>> > >>> [1] https://issues.apache.org/jira/browse/ISIS-666 > >>> [2] http://markmail.org/message/xhmeq62ywr2vqvje > >>> [3] > >>> > http://isis.apache.org/components/objectstores/jdo/managed-1-to-m-relationships.html > >>> > >>> > >>> > >>> On 27 March 2014 07:39, Jeroen van der Wal <[email protected]> > wrote: > >>> > >>> > >>> accidentally sent, add this: > >>>> > >>>> public Invoice addInvoiceItem(..) { > >>>> invoiceItems.create(...); > >>>> > >>>> * return this;* > >>>> } > >>>> > >>>> I agree that the viewer should return the last screen after a void > action. > >>>> Perhaps you could raise a ticket? > >>>> > >>>> Cheers, > >>>> > >>>> Jeroen > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> On Thu, Mar 27, 2014 at 8:33 AM, Jeroen van der Wal < > [email protected] > >>>> > >>>> wrote: > >>>> > >>>> Hi John, welcome to the Isis mailing list. > >>>>> > >>>>> If you use JDO there's no need to use the mutual registration > pattern [1] > >>>>> which saves a lot of boilerplate code. > >>>>> > >>>>> The pattern that we have currently in Estatio when creating child > object > >>>>> return the parent object after adding a new child. > >>>>> > >>>>> public Invoice addInvoiceItem(..) { > >>>>> .... > >>>>> > >>>>> } > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> On Thu, Mar 27, 2014 at 1:53 AM, John Lafer <[email protected]> > wrote: > >>>>> > >>>>> > >>>>> Hello Isis Users, > >>>>>> > >>>>>> I'm a first-time user with likely a naive question. I'm using Isis > 1.40 > >>>>>> and the Wicket viewer. I defined an action for a (parent) entity > that > >>>>>> allows the user to create a child (1-M) object and add it to a > >>>>>> collection > >>>> > >>>> in the parent. When the user fills out the required child fields and > >>>>>> presses the OK button in the modal dialog window, the view switches > to a > >>>>>> page with a message ("No results") under a title ("Add a <name of > child > >>>>>> entity>"). I wrote the action to return void and I thought this > would > >>>>>> allow > >>>> > >>>> the action to return the user to the parent entity detail (or edit) > >>>>>> page, > >>>> > >>>> which is what I desire. I've implemented the mutual registration > pattern > >>>>>> and the child object is being added to the parent's collection just > >>>>>> fine. > >>>> > >>>> Any ideas on what I'm missing? > >>>>>> > >>>>>> Thanks in advance. > >>>>>> John > >> > >> > >> Óscar Bou Bou > >> Responsable de Producto > >> Auditor Jefe de Certificación ISO 27001 en BSI > >> CISA, CRISC, APMG ISO 20000, ITIL-F > >> > >> 902 900 231 / 620 267 520 > >> http://www.twitter.com/oscarbou > >> > >> http://es.linkedin.com/in/oscarbou > >> > >> http://www.GesConsultor.com > >> > >> > >> > >> > >> > >> Este mensaje y los ficheros anexos son confidenciales. Los mismos > contienen información reservada que no puede ser difundida. Si usted ha > recibido este correo por error, tenga la amabilidad de eliminarlo de su > sistema y avisar al remitente mediante reenvío a su dirección electrónica; > no deberá copiar el mensaje ni divulgar su contenido a ninguna persona. > >> Su dirección de correo electrónico junto a sus datos personales constan > en un fichero titularidad de Gesdatos Software, S.L. cuya finalidad es la > de mantener el contacto con Ud. Si quiere saber de qué información > disponemos de Ud., modificarla, y en su caso, cancelarla, puede hacerlo > enviando un escrito al efecto, acompañado de una fotocopia de su D.N.I. a > la siguiente dirección: Gesdatos Software, S.L. , Paseo de la Castellana, > 153 bajo - 28046 (Madrid), y Avda. Cortes Valencianas num. 50, 1ºC - 46015 > (Valencia). Asimismo, es su responsabilidad comprobar que este mensaje o > sus archivos adjuntos no contengan virus informáticos, y en caso que los > tuvieran eliminarlos. > >> > >> > >> > >> > >> > >> >
