Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 59602 invoked from network); 9 Aug 2010 08:18:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Aug 2010 08:18:03 -0000 Received: (qmail 20492 invoked by uid 500); 9 Aug 2010 08:18:02 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 20330 invoked by uid 500); 9 Aug 2010 08:17:59 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 20322 invoked by uid 99); 9 Aug 2010 08:17:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 08:17:58 +0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=SPF_HELO_PASS,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 08:17:51 +0000 Received: from jim.nabble.com ([192.168.236.80]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OiNY1-0006ee-7n for dev@openjpa.apache.org; Mon, 09 Aug 2010 01:17:29 -0700 Date: Mon, 9 Aug 2010 01:17:29 -0700 (PDT) From: wendyLG To: dev@openjpa.apache.org Message-ID: <1281341849236-5388167.post@n2.nabble.com> In-Reply-To: References: <1281095228347-5380244.post@n2.nabble.com> <1281099904275-5380487.post@n2.nabble.com> <1281109001566-5381051.post@n2.nabble.com> Subject: Re: beans, Enitiy annotation and bytcode enhancement MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org This is the simplest i can manange: @Entity(name="testTable") @Table(name = "test_table", catalog = "lcw") public class TestBean { int id; String data1; String data2; @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true, nullable = false) public int getId() { return id; } public void setId(int id_) { id = id_; } @Column(name="data_1") public String getData1() { return data1; } public void setData1(String data1_) { data1 = data1_; } @Column(name="data_2") public String getData2() { return data2; } public void setData2(String data2_) { data2 = data2_; } } test.program.TestBean public class UnitTestBean { private static EntityManagerFactory emf; private static ThreadLocal threadLocal; @Before public void setUp() throws Exception { } @After public void tearDown() throws Exception { } @Test public void testOne() { emf = Persistence.createEntityManagerFactory("LCWCommonPU"); System.err.println("EMF:" + emf); threadLocal = new ThreadLocal(); final String queryString; queryString = "select model from testTable model order by model.id"; Query query = getEntityManager().createQuery(queryString); List resultList = query.getResultList(); } private EntityManager getEntityManager() { EntityManager manager = threadLocal.get(); if (manager == null || !manager.isOpen()) { manager = emf.createEntityManager(); threadLocal.set(manager); } return manager; } } org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter "select model from testTable model order by model.id". Error message: The name "testTable" is not a recognized entity or identifier. Perhaps you meant TestBean, which is a close match. Known entity names: [TestBean] This very test worked before i added bytecode enahncement. my enchancement options: http://openjpa.208410.n2.nabble.com/file/n5388167/bytecode.jpg -- View this message in context: http://openjpa.208410.n2.nabble.com/beans-Enitiy-annotation-and-bytcode-enhancement-tp5380244p5388167.html Sent from the OpenJPA Developers mailing list archive at Nabble.com.