pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérôme Serré <jerome.michel.se...@gmail.com>
Subject RE: QueryServlet/Hibernate
Date Fri, 27 Aug 2010 14:22:43 GMT
It's ok, i have received it.

-----Message d'origine-----
De : Greg Brown [mailto:gkbrown@mac.com] 
Envoyé : vendredi 27 août 2010 14:03
À : user@pivot.apache.org
Objet : 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...
> 
> 
> On Fri, Aug 27, 2010 at 2:14 PM, Taro App <apptaro@gmail.com> wrote:
>> Yes, I may not have enough time to write up a blog entry, I'll just 
>> attach the demo here. It's a war file with the source code. Should 
>> work on Java 1.6 + Tomcat 6.0. Libraries used are:
>> 
>> - 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!
>> 
>> jpaqueryservlet.servlet.ContactQueryServlet extends QueryServlet to 
>> provide CRUD services for Contact data, which only has id, last name, 
>> first name and version for optimistic locking. ContactQueryServlet 
>> makes calls to ContactDao, and ContactDao uses JPA for database 
>> access. Hibernate provides the underlining database work for JPA, as 
>> 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 
>> open-session-in-view pattern, which may also be a bit overly complex 
>> for the purpose. Derby database is started and shutted down by 
>> DerbyManagerListener, a servlet context listener. ContactWsTest is 
>> the class to test the web service.
>> 
>> apptaro
>> 
>> 
>> 
>> On Thu, Aug 26, 2010 at 9:25 PM, Greg Brown <gkbrown@mac.com> wrote:
>>> Nice! Can we see it, or do we have to wait for the blog entry?  :-)
>>> 
>>> On Aug 26, 2010, at 7:14 AM, Taro App wrote:
>>> 
>>>> Hi Greg,
>>>> 
>>>> 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.
>>>> 
>>>> apptaro
>>>> 
>>>> 
>>>> 
>>>> On Thu, Aug 26, 2010 at 11:41 AM, Greg Brown <gkbrown@mac.com> 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.
>>>>> 
>>>>> 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.
>>>>> 
>>>>> G
>>>>> 
>>>>> 
>>> 
>>> 
>> 


Mime
View raw message