Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 75930 invoked from network); 16 Nov 2010 16:36:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Nov 2010 16:36:03 -0000 Received: (qmail 48836 invoked by uid 500); 16 Nov 2010 16:36:35 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 48778 invoked by uid 500); 16 Nov 2010 16:36:34 -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 48770 invoked by uid 99); 16 Nov 2010 16:36:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Nov 2010 16:36:34 +0000 X-ASF-Spam-Status: No, hits=-1998.7 required=10.0 tests=ALL_TRUSTED,URI_HEX X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Nov 2010 16:36:33 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oAGGaDhT007315 for ; Tue, 16 Nov 2010 16:36:13 GMT Message-ID: <29324448.111741289925373227.JavaMail.jira@thor> Date: Tue, 16 Nov 2010 11:36:13 -0500 (EST) From: "wendy gibbons (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-1887) eclipse bytecode enhancer ignoring annotations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 eclipse bytecode enhancer ignoring annotations ---------------------------------------------- Key: OPENJPA-1887 URL: https://issues.apache.org/jira/browse/OPENJPA-1887 Project: OpenJPA Issue Type: Bug Components: Enhance Affects Versions: 1.2.2 Environment: windows xp, eclipse 3.5 bytecode enhance OpenJPA Eclipse Feature 1.0.0.201001181728 OpenJPA 1.2.2 Reporter: wendy gibbons This is long and very detailed as it is the result of a discussion on http://openjpa.208410.n2.nabble.com/beans-Enitiy-annotation-and-bytcode-enhancement-td5380244.html#a5744274 when i use the eclipse bytecode enhancer the annotation @Entity(name="testTable") is ignored and all youhave available if the class name BEAN: @Entity(name="testTable") @Table(name = "cocktails") public class TestBean implements IBean{ Integer id; String data1; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", unique = true, nullable = false) public Integer getId() { return id; } public void setId(Integer id_) { id = id_; } @Column(name="name") public String getData1() { return data1; } public void setData1(String data1_) { data1 = data1_; } } DAO: public class TestDAO extends BaseDAO { @Override public List findAll() { return findAll("testTable"); } } main: public static void main(String[] args) { TestDAO dao = new TestDAO(); List findAll = dao.findAll(); for (TestBean testBean : findAll) { System.out.println(testBean.getData1()); } } persistence.xml: org.apache.openjpa.persistence.PersistenceProviderImpl com.test.dao.Cocktail com.test.dao.TestBean ... creating a main and selecting from TestBean (no enhancement) i get: 16-Nov-2010 15:42:03 com.test.dao.EntityManagerHelper log INFO: finding allTest 110 TestPU INFO [main] openjpa.Runtime - Starting OpenJPA 1.2.2 250 TestPU INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.MySQLDictionary". 781 TestPU INFO [main] openjpa.Enhance - Creating subclass for "[class com.test.dao.Cocktail, class com.test.dao.TestBean]". This means that your application will be less efficient and will consume more memory than it would if you ran the OpenJPA enhancer. Additionally, lazy loading will not be available for one-to-one and many-to-one persistent attributes in types using field access; they will be loaded eagerly instead. 1594 TestPU TRACE [main] openjpa.jdbc.SQL - executing prepstmnt 21465667 SELECT t0.id, t0.name, t0.activeYN FROM cocktails t0 ORDER BY t0.id ASC 1610 TestPU TRACE [main] openjpa.jdbc.SQL - [16 ms] spent running using the runtime enhancer: (putting -javaagent:C:\JavaProjects\OpenJpaTest\WebContent\WEB-INF\lib\openjpa-1.2.2.jar in the run configuration arguments) 16-Nov-2010 15:44:11 com.test.dao.EntityManagerHelper log INFO: finding allTest 141 TestPU INFO [main] openjpa.Runtime - Starting OpenJPA 1.2.2 235 TestPU INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.MySQLDictionary". 1829 TestPU TRACE [main] openjpa.jdbc.SQL - executing prepstmnt 30702379 SELECT t0.id, t0.name, t0.activeYN FROM cocktails t0 ORDER BY t0.id ASC 1860 TestPU TRACE [main] openjpa.jdbc.SQL - [31 ms] spent And using the eclipse bytecode enhancer plugin: 16-Nov-2010 15:45:32 com.test.dao.EntityManagerHelper log INFO: finding allTest 109 TestPU INFO [main] openjpa.Runtime - Starting OpenJPA 1.2.2 250 TestPU INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.MySQLDictionary". 16-Nov-2010 15:45:33 com.test.dao.EntityManagerHelper log SEVERE: find all failed name failed 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, Cocktail] at org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(AbstractExpressionBuilder.java:118) . Trying now with the latest version of openjpa jar -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.