Return-Path: Delivered-To: apmail-pivot-user-archive@www.apache.org Received: (qmail 67299 invoked from network); 27 Aug 2010 14:23:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Aug 2010 14:23:27 -0000 Received: (qmail 33564 invoked by uid 500); 27 Aug 2010 14:23:27 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 33421 invoked by uid 500); 27 Aug 2010 14:23:25 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 33413 invoked by uid 99); 27 Aug 2010 14:23:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Aug 2010 14:23:24 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jerome.michel.serre@gmail.com designates 209.85.215.54 as permitted sender) Received: from [209.85.215.54] (HELO mail-ew0-f54.google.com) (209.85.215.54) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Aug 2010 14:23:16 +0000 Received: by ewy4 with SMTP id 4so2183992ewy.13 for ; Fri, 27 Aug 2010 07:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:message-id:mime-version:content-type :content-transfer-encoding:x-mailer:thread-index:content-language; bh=CXswAGe7pfaSUXFflu3SY+z5ZxA7hk+0D4Vegr9MIUc=; b=hrsW+uuOP0LUpMMXL+CPo0pUNG/EQUPBAUKWQmWn8W0ObhPjnmMNnFU8x631GSX/xj FOMArFAgV/f0w6GuY7FCyI7wW9guHbfpZLAyzAmEkhRMisTlPz19AeBVkI9NUXr721LI oC/57ioUE8H2s9ZhC4bVTLYdH55RAuxJOMGdY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; b=uRVwcP12iA0xEHovNiNPhKqo+gIICNIfYLO0QmSG9JyDfn7gQrK4NNtwkYU5p1vY/t XBn7bApD6UPPyINlDmWhO7N2u96fw6Fm7FuURhVO10a0GA6SeRr17sbINaFo2rRw0qGo NOyHOFbCas07rqIHEZfv7/xOh2g4PiF/lrQJ0= Received: by 10.213.10.70 with SMTP id o6mr2356927ebo.31.1282918975432; Fri, 27 Aug 2010 07:22:55 -0700 (PDT) Received: from THANAOS (HSI-KBW-082-212-051-100.hsi.kabelbw.de [82.212.51.100]) by mx.google.com with ESMTPS id v59sm6192794eeh.22.2010.08.27.07.22.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 27 Aug 2010 07:22:54 -0700 (PDT) From: =?iso-8859-1?B?Suly9G1lIFNlcnLp?= To: References: In-Reply-To: Subject: RE: QueryServlet/Hibernate Date: Fri, 27 Aug 2010 16:22:43 +0200 Message-ID: <002701cb45f3$51605bb0$f4211310$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGW1V8JDwjYe3+LA6T1TQO3DrkkzQI9lcQHAi+F/zYCAquiQwDr6psLApMFnViTDsX/YA== Content-Language: fr It's ok, i have received it. -----Message d'origine----- De=A0: Greg Brown [mailto:gkbrown@mac.com]=20 Envoy=E9=A0: vendredi 27 ao=FBt 2010 14:03 =C0=A0: user@pivot.apache.org Objet=A0: Re: QueryServlet/Hibernate The attachment didn't come through - may have been too big. Is it = possible for you to post it to a web server somewhere? Sounds like it would make a great blog entry, if you do have time to = write one! On Aug 27, 2010, at 1:16 AM, Taro App wrote: > Oops, sorry for the large attachment. I hope it wouldn't clog anyone's = > mail server... >=20 >=20 > On Fri, Aug 27, 2010 at 2:14 PM, Taro App wrote: >> Yes, I may not have enough time to write up a blog entry, I'll just=20 >> attach the demo here. It's a war file with the source code. Should=20 >> work on Java 1.6 + Tomcat 6.0. Libraries used are: >>=20 >> - Hibernate 3.5.5 (with Annotation & JPA) >> - Apache Derby 10.6.1.0 (Embeded, In Memory) >> - JUnit 4.8.2 >> and of course, Apache Pivot 1.5.1 QueryServlet! >>=20 >> jpaqueryservlet.servlet.ContactQueryServlet extends QueryServlet to=20 >> provide CRUD services for Contact data, which only has id, last name, = >> first name and version for optimistic locking. ContactQueryServlet=20 >> makes calls to ContactDao, and ContactDao uses JPA for database=20 >> access. Hibernate provides the underlining database work for JPA, as=20 >> configured in persistence.xml. ContactDao is a bit overly complex for = >> the purpose of this demo, but it uses JPA generic DAO pattern. >> OpenEntityManagerInViewFilter, a servlet filter, provides=20 >> open-session-in-view pattern, which may also be a bit overly complex=20 >> for the purpose. Derby database is started and shutted down by=20 >> DerbyManagerListener, a servlet context listener. ContactWsTest is=20 >> the class to test the web service. >>=20 >> apptaro >>=20 >>=20 >>=20 >> On Thu, Aug 26, 2010 at 9:25 PM, Greg Brown wrote: >>> Nice! Can we see it, or do we have to wait for the blog entry? :-) >>>=20 >>> On Aug 26, 2010, at 7:14 AM, Taro App wrote: >>>=20 >>>> Hi Greg, >>>>=20 >>>> I made a simple demo with QueryServlet/Hibernate/JPA and JUnit = test. >>>> I'll clean up some more and will publish it on my blog. >>>>=20 >>>> apptaro >>>>=20 >>>>=20 >>>>=20 >>>> On Thu, Aug 26, 2010 at 11:41 AM, Greg Brown = wrote: >>>>> It occurred to me earlier this evening that QueryServlet might = make a good REST-based front end to Hibernate or some other Java-based ORM = tool. However, I don't have a lot of experience with ORMs - the DB apps I have written have generally used JDBC directly. >>>>>=20 >>>>> Anyone with Hibernate knowledge care to comment (or possibly write = up a simple demo to test the theory)? I think an example that retrieves a = bean from the DB and uses JSONSerializer to write it back out to the caller = would be very cool. I'd be happy to help with such an example if anyone is interested. >>>>>=20 >>>>> G >>>>>=20 >>>>>=20 >>>=20 >>>=20 >>=20