Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 71553 invoked from network); 20 Nov 2009 20:32:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Nov 2009 20:32:06 -0000 Received: (qmail 38554 invoked by uid 500); 20 Nov 2009 20:32:06 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 38507 invoked by uid 500); 20 Nov 2009 20:32:05 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 38497 invoked by uid 99); 20 Nov 2009 20:32:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Nov 2009 20:32:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of seba.wagner@gmail.com designates 209.85.223.201 as permitted sender) Received: from [209.85.223.201] (HELO mail-iw0-f201.google.com) (209.85.223.201) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Nov 2009 20:31:54 +0000 Received: by iwn39 with SMTP id 39so2641761iwn.25 for ; Fri, 20 Nov 2009 12:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=WQ+9eZkrmFhQzUu8vp7A77ahi6DFypJDxQGlNFvG2RA=; b=XIliKS3InQOnoM0CYIN7aexjxEs2kNNGgjQKrf4cIOvQhlBEvusnzSvQSl34+IYx4O JDQBZjwX/U4tSowJrNCLX+hWcmhxG7BOrU7pkb97qNO4a8bsZcdpmhcI+GPFnG7HMaPK YJPgK5XHFbODjm5Mzg0eR/aISvSu1/VeMs+4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=m5HckpPTxow+R04wlkQjUUBoOgndoTfWEzQXBjSABddRuWsHJTPgBKnDt6WM50QQhT vNK/iWrW7BeICRiRWe0qJrIOhxUKKAsKRIAdyZ3xsH32R+AtFDrXML3Z/PCO2QisvuGg aftvi9dLZiGO+y1obs/TUQnlTOFwOp60KMTzk= MIME-Version: 1.0 Received: by 10.231.48.210 with SMTP id s18mr2179930ibf.3.1258749093338; Fri, 20 Nov 2009 12:31:33 -0800 (PST) In-Reply-To: <89c0c52c0911201202y5742efd6jd2f2299dee788260@mail.gmail.com> References: <1434b04c0911200147p2c6b06fhfced865ec38498ae@mail.gmail.com> <89c0c52c0911201202y5742efd6jd2f2299dee788260@mail.gmail.com> Date: Fri, 20 Nov 2009 21:31:33 +0100 Message-ID: <1434b04c0911201231x606d1845o431872f58f314eb4@mail.gmail.com> Subject: Re: Migration strategy from Hibernate From: Sebastian Wagner To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=0015176f115c91df9b0478d35c18 X-Virus-Checked: Checked by ClamAV on apache.org --0015176f115c91df9b0478d35c18 Content-Type: text/plain; charset=ISO-8859-1 wow, that is quite extended material, thanks for the link. I will study and come back. sebastian 2009/11/20 Kevin Sutter > Hi Sebastian, > I'm sorry to day that we don't have a cookbook on this Hibernate migration > exercise. I would highly suggest (beg?) that you take good notes during > this migration so that we can all learn from the experience. > > I'm assuming you are moving from Hibernate "classic", meaning pre-JPA > programming model. Otherwise known as the Hibernate Session programming > model. If you are actually on moving from Hibernate JPA to OpenJPA, then > the migration should be relatively straight forward. But, from the content > of your notes below, I believe you are migrating from "classic" to OpenJPA. > > To that end, a colleague of mine and myself have written a white paper [1] > outlining the common Hibernate "classic" programming model paradigms and > how > to best map them to OpenJPA. So, I would start with that white paper and > see it gets you started. > > Also, OpenJPA supports both Annotations and XML, so if you feel more > comfortable with the XML configuration approach, you could stick with that. > > I hope this helps. > Good luck and let us know how it goes! > Kevin > > [1] > > http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html > > On Fri, Nov 20, 2009 at 3:47 AM, Sebastian Wagner >wrote: > > > hi, > > > > > > in follow up from a discussion on the Apache General List: > > > > > http://mail-archives.apache.org/mod_mbox/incubator-general/200911.mbox/%3C1434b04c0911200121g2d99f359m9c27fa41fe63ac72@mail.gmail.com%3E > > > > I have some quite basic questions about migrating a existing Project > using > > Hibernate to openJPA. > > > > We are using a Hibernate 3.4 + XDoclet2 to generate the HBM files. > > We don't use a Spring Managed Transaction Manager yet for handling the > > Session (but we should). > > We have a lot of HQL Statements in the Code. > > The project is: http://openmeetings.googlecode.com > > (For anybody interested the Sources are located into > > > > > http://openmeetings.googlecode.com/svn/trunk/singlewebapp/src/app/org/openmeetings/app/ > > ) > > And we are applying for Apache Incubation, so we have to get rid of > > Hibernate. > > > > What is your general advice on an easy way to migrate to openJPA? > > > > Writing the intermediate database description per object, you use > > annotations I guess? > > In what kind of Java-Structure do you Map Many-To-One relations? > > How do you handle Multi-Threaded Applications and Database Caches? In > > hibernate a very common problem is that you have problems with Objects > that > > are several times in the Cache but in different Threads. In that case a > > Session.flush does not really work as it only flushs one Thread. This can > > be > > solved in Hibernate by using a Spring managed Transaction Manager. What > is > > JPAs approach in that area? > > And finally => HQL Statements, I guess I have to rewrite them all, but is > > the openJPA *JPQL* very different from that? From what I have seen its > not > > that big Issue to refactor those statements to JPQL. > > > > And I have a lot more questions before I can finally decide on what is > the > > best and feasable way to migrate. > > But I am eager to learn ^^ so maybe somebody is eager to give us some > tipps > > > > I will try to study the docs, > > but i have not seen any kick-start example yet that covers the most of > > basic > > topics. Is there any sample that can be re-used? > > > > > > thanks a lot > > Sebastian Wagner > > > > -- > > Sebastian Wagner > > http://www.webbase-design.de > > http://openmeetings.googlecode.com > > http://www.laszlo-forum.de > > seba.wagner@gmail.com > > > -- Sebastian Wagner http://www.webbase-design.de http://openmeetings.googlecode.com http://www.laszlo-forum.de seba.wagner@gmail.com --0015176f115c91df9b0478d35c18--