Return-Path: X-Original-To: apmail-tomee-users-archive@www.apache.org Delivered-To: apmail-tomee-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 114211057F for ; Sun, 20 Oct 2013 16:04:41 +0000 (UTC) Received: (qmail 78420 invoked by uid 500); 20 Oct 2013 16:04:40 -0000 Delivered-To: apmail-tomee-users-archive@tomee.apache.org Received: (qmail 78406 invoked by uid 500); 20 Oct 2013 16:04:36 -0000 Mailing-List: contact users-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tomee.apache.org Delivered-To: mailing list users@tomee.apache.org Received: (qmail 78394 invoked by uid 99); 20 Oct 2013 16:04:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Oct 2013 16:04:34 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of maxtorzito@gmail.com designates 209.85.217.170 as permitted sender) Received: from [209.85.217.170] (HELO mail-lb0-f170.google.com) (209.85.217.170) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Oct 2013 16:04:28 +0000 Received: by mail-lb0-f170.google.com with SMTP id u14so1751949lbd.15 for ; Sun, 20 Oct 2013 09:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Te1XM76R4zx5a8uoX0zFaRTB8oxL2UbxJG+imGg0soM=; b=tQInaPJPnpCGUF5v8phy4xPmQHDSCp+9jbRwbvpDC79lHQFCZ9bzSz8872qVypQpww yyvnwLECo5ci81KdRG9Cp94FGhcky631o2Ava8PB2lX0TnkxtYTaLlJYSsktmDhxjhOC 7VQeTOL3jWOUpahxUHk6W0Ns289rzjHvGk3OmH0mUlRo8deti2bX2CaE0UWILPNiMSHQ NkmzzQkEa9Rg3SQnCBiWWI3c6kUvXAoHTsCYiAMLeofPeDMgXAg3p3G2xHC0Qn7eO5Zf deK5zfCKn+t8OPTg7i35RjU9k0RU9hjZ6xRyIRQ80FaIEJfR0MkOdt/GZTznI4p/KOrH oE4Q== MIME-Version: 1.0 X-Received: by 10.112.89.100 with SMTP id bn4mr10050991lbb.16.1382285047838; Sun, 20 Oct 2013 09:04:07 -0700 (PDT) Received: by 10.112.5.164 with HTTP; Sun, 20 Oct 2013 09:04:07 -0700 (PDT) Received: by 10.112.5.164 with HTTP; Sun, 20 Oct 2013 09:04:07 -0700 (PDT) In-Reply-To: <1382269878.92746.YahooMailNeo@web28905.mail.ir2.yahoo.com> References: <1382167015.36881.YahooMailNeo@web28901.mail.ir2.yahoo.com> <1382194175.59249.YahooMailNeo@web28902.mail.ir2.yahoo.com> <1382211989.70533.YahooMailNeo@web28905.mail.ir2.yahoo.com> <1382269878.92746.YahooMailNeo@web28905.mail.ir2.yahoo.com> Date: Sun, 20 Oct 2013 11:04:07 -0500 Message-ID: Subject: Re: Entity cant be refreshed with new list values From: =?ISO-8859-1?Q?Jos=E9_Luis_Cetina?= To: users@tomee.apache.org Content-Type: multipart/alternative; boundary=001a11c379ec413d9004e92e5158 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c379ec413d9004e92e5158 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Responses inline. El 20/10/2013 06:51, "Mark Struberg" escribi=F3: > > Romain, that's nowhere in the spec. Thus it must work. Really! If this is true, what im doing wrong? Or this is openjpa or tomee issue? > > The only thing which is specified to be immutable are lists returned by query.getResultList. > That's the reason why you should not back a sortable h:dataTable by a list you get from JPA directly. > All other stuff is perfectly mutable. > > LieGrue, > strub > > > > > >________________________________ > > From: Romain Manni-Bucau > >To: users@tomee.apache.org > >Sent: Sunday, 20 October 2013, 10:00 > >Subject: Re: Entity cant be refreshed with new list values > > > > > >Not really. An entity handles a state which can prevent it. Nothing > >mandates it to work > > > >Le 20 oct. 2013 09:50, "Jos=E9 Luis Cetina" a =E9= crit : > > > >> What about using a detached entity?? The detached entity will work like a > >> DTO? > >> > >> From Real World Java EE Patterns (Adam Biem) 2009 > >> Problem > >> The origin problem statement was: =93You want to transfer multiple dat= a > >> elements over a tier=94 > >> ( > >> > >> http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.htm= l > >> ). > >> This particular problem was elegantly solved in Java EE 5 with detachment > >> of persistent entities. There is > >> no need for the introduction of another class just for transferring th= e > >> entities data. JPA entities can > >> implement a java.io.Serializable interface and be transferred between > >> tiers, even remote ones. > >> CMP 2.x entities weren=92t Serializable, the developer was forced to c= opy > >> their states to a remotely > >> transferable structure=97the Transfer Object. > >> > >> > >> > >> 2013/10/19 Howard W. Smith, Jr. > >> > >> > responses below... > >> > > >> > On Sat, Oct 19, 2013 at 3:46 PM, Mark Struberg > >> wrote: > >> > > >> > > be careful with immediate=3Dtrue. You get all sorts of nasty side > >> effects. > >> > > > >> > > see page 92 in > >> > > > >> > > >> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pi= tfalls%20in%20EE.pdf > >> > > > >> > > > >> > I definitely agree and understand about immediate=3Dtrue, and guess what, i > >> > found it very useful to disable validation as instructed on page 92 of > >> the > >> > PDF file. > >> > > >> > clarification of my use/understanding: > >> > > >> > i am 'not' using immediate=3Dtrue, when i user is to select a row on > >> > datatable, and then click commandbutton/link/menuitem, which does a POST > >> of > >> > the selected row on the datatable, and bean uses the selected row to > >> > prepare the UI for the next view that is 'rendered' via > >> > ui:include=3D#{bean.page}. see below and keep reading, please. > >> > > >> > >> > > >> > actionListener=3D"#{pf_pointOfContactController.prepareCreate()}" > >> > update=3D"#{pf_pointOfContactController.getAjaxUpdate()}"/> > >> > >> > > >> > actionListener=3D"#{pf_pointOfContactController.prepareEdit()}" > >> > update=3D"#{pf_pointOfContactController.getAjaxUpdate()}"/> > >> > >> > > >> > actionListener=3D"#{pf_pointOfContactController.prepareView()}" > >> > update=3D"#{pf_pointOfContactController.getAjaxUpdate()}"/> > >> > > >> > >> > > >> > actionListener=3D"#{pf_pointOfContactController.copySelectedRows()}" > >> > update=3D"#{pf_pointOfContactController.getAjaxUpdate()}"/> > >> > >> > > >> > > >> actionListener=3D"#{pf_pointOfContactController.confirmDeleteSelectedRows()= }" > >> > update=3D"#{pf_pointOfContactController.getAjaxUpdate()}"/> > >> > > >> > but, for a readonly page that has commandbutton/links to render a ne= w > >> view, > >> > based on the current @Entity that is held in the JSF controller/bean > >> class, > >> > i use immediate=3Dtrue without issue and I think it fits/meets the > >> > occasion/requirement, because there is no need to do validation phase or > >> > update model values. see below. :) > >> > > >> > >> immediate=3D"true" > >> > update=3D"#{pf_pointOfContactController.getAjaxUpdate()}" > >> > > >> > actionListener=3D"#{pf_pointOfContactController.prepareList()}"/> > >> > >> > immediate=3D"true" update=3D"#{pf_pointOfContactController.getAjaxUpdate()}" > >> > > >> > actionListener=3D"#{pf_pointOfContactController.confirmDelete()}"/> > >> > >> > immediate=3D"true" update=3D"#{pf_pointOfContactController.getAjaxUpdate()}" > >> > > >> > actionListener=3D"#{pf_pointOfContactController.prepareEdit()}"/> > >> > > >> > >> > >> > >> -- > >> ------------------------------------------------------------------- > >> *SCJA. Jos=E9 Luis Cetina* > >> ------------------------------------------------------------------- > >> > > > > --001a11c379ec413d9004e92e5158--