openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wendyLG <>
Subject Re: beans, Enitiy annotation and bytcode enhancement
Date Mon, 09 Aug 2010 08:17:29 GMT

This is the simplest i can manange:

@Table(name = "test_table", catalog = "lcw")
public class TestBean {

	int	id;
	String data1;
	String data2;
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return id;
	public void setId(int id_) {
		id = id_;
	public String getData1() {
		return data1;
	public void setData1(String data1_) {
		data1 = data1_;
	public String getData2() {
		return data2;
	public void setData2(String data2_) {
		data2 = data2_;

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns=""
	<persistence-unit name="LCWCommonPU">
			<property name="openjpa.ConnectionDriverName"
				value="com.mysql.jdbc.Driver" />
			<property name="openjpa.ConnectionDriverName"
value="com.mysql.jdbc.Driver" />
			<property name="openjpa.ConnectionURL"
value="jdbc:mysql://localhost:3306/lcw" />
			<property name="openjpa.ConnectionUserName" value="***" />
			<property name="openjpa.ConnectionPassword" value="****" />
			<property name="openjpa.jdbc.UpdateManager" value="operation-order"/>
			<property name="openjpa.DataCache" value="true" />
			<property name="openjpa.RemoteCommitProvider" value="sjvm" />
 			<property name="openjpa.DataCacheTimeout" value="100000" />


public class UnitTestBean {

	private static EntityManagerFactory emf;
	private static ThreadLocal<EntityManager> threadLocal;
	public void setUp() throws Exception {

	public void tearDown() throws Exception {

	public void testOne() {
		emf = Persistence.createEntityManagerFactory("LCWCommonPU");
		System.err.println("EMF:" + emf);
		threadLocal = new ThreadLocal<EntityManager>();
		final String queryString;
		queryString = "select model from testTable model order by";
		Query query = getEntityManager().createQuery(queryString);
		List resultList = query.getResultList();

	private EntityManager getEntityManager() {
		EntityManager manager = threadLocal.get();
		if (manager == null || !manager.isOpen()) {
			manager = emf.createEntityManager();
		return manager;

<openjpa-1.2.2-r422266:898935 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: An error occurred while
parsing the query filter "select model from testTable model order by". 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: 

View this message in context:
Sent from the OpenJPA Developers mailing list archive at

View raw message