Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 89865 invoked from network); 3 Jun 2010 11:19:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Jun 2010 11:19:40 -0000 Received: (qmail 7537 invoked by uid 500); 3 Jun 2010 11:19:40 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 7433 invoked by uid 500); 3 Jun 2010 11:19:38 -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 7425 invoked by uid 99); 3 Jun 2010 11:19:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jun 2010 11:19:36 +0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.158 is neither permitted nor denied by domain of opengloves@gmail.com) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jun 2010 11:19:31 +0000 Received: from jim.nabble.com ([192.168.236.80]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OK8S6-0008Q7-L0 for users@openjpa.apache.org; Thu, 03 Jun 2010 04:19:10 -0700 Date: Thu, 3 Jun 2010 04:19:10 -0700 (PDT) From: Zhanming Qi To: users@openjpa.apache.org Message-ID: <1275563950641-5134729.post@n2.nabble.com> In-Reply-To: <468534.53681.qm@web55901.mail.re3.yahoo.com> References: <1275311401746-5121731.post@n2.nabble.com> <468534.53681.qm@web55901.mail.re3.yahoo.com> Subject: Re: openjpa-2.0 how join fetch work? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, Here is my POJOs. Corporation is: @Entity @Table(name = "CORPORATION") public class Corporation implements Serializable{ private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID", nullable = false) private int id; @Column(name = "CORPORATION_NAME") private String name; @OneToMany(mappedBy = "corporation", fetch = FetchType.LAZY) private Set divisions; @Version private int version; public Corporation() { } getter and setter } Division is: @Entity @Table(name = "DIVISION") public class Division implements Serializable{ private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID", nullable = false) private long id; private String name; private long mumber; @Embedded private Address address; @ManyToOne @JoinColumn(name = "CORPORATION_ID") private Corporation corporation; @OneToMany(mappedBy = "division") private Set departments; @Version private int version; public Division() { } getter and setter } Thanks. Zhanming -- View this message in context: http://openjpa.208410.n2.nabble.com/openjpa-2-0-how-join-fetch-work-tp5121731p5134729.html Sent from the OpenJPA Users mailing list archive at Nabble.com.