Timestamp in JPQL where clause issue

2009-07-27 Thread wang yu
Hello, I met an OpenJPA Timestamp filed in JPQL where clause issue. I used it as: EntityManagerFactory factory = Persistence.createEntityManagerFactory( test, System.getProperties()); String sql= SELECT callpath FROM

Re: Timestamp in JPQL where clause issue

2009-07-27 Thread wang yu
And I used OpenJPA 1.2.1. -Yu Wang On Mon, Jul 27, 2009 at 2:20 PM, wang yuwangy...@gmail.com wrote: Hello, I met an OpenJPA Timestamp filed in JPQL where clause issue. I used it as:                EntityManagerFactory factory = Persistence.createEntityManagerFactory(                      

Re: Timestamp in JPQL where clause issue

2009-07-27 Thread Pinaki Poddar
Hi, Can you please change the parameter name from to something else? The error is during parse and may have be related to the fact that from is a reserved word in JPQL. - Pinaki -- View this message in context:

enhancing entity which is a subclass

2009-07-27 Thread pdd
Everything works with EclipseLink and TopLink but fails with OpenJPA. Tried with runtime as well as build time enhancement. The problem is the entity class is a subclass. In this test case, it is an empty class which inherits everything from the base class UserModelBaseImpl. ... ... ...

One-sided @OneToMany

2009-07-27 Thread Jean-Baptiste BRIAUD -- Novlog
Hi, I'm new to OpenJPA. Just few background words before my first question. My walk to OpenJPA was Hibernate when it was early alpha on persistence with annotations, then CakePHP for the shake of simplicity and now OpenJPA because : * fetch group. I didn't know the name before I read

Re: enhancing entity which is a subclass

2009-07-27 Thread Rick Curtis
Can you post snippets of your Entities and your persistence.xml file? -Rick On Mon, Jul 27, 2009 at 7:47 AM, pdd pbar...@gmail.com wrote: Everything works with EclipseLink and TopLink but fails with OpenJPA. Tried with runtime as well as build time enhancement. The problem is the entity

Re: enhancing entity which is a subclass

2009-07-27 Thread pdd
Here are the relevant snippets. persistence.xml fragment - persistence-unit name=UserAdmin transaction-type=RESOURCE_LOCAL !-- Explicitly define mapping file path, else Hibernate won't find the default -- non-jta-data-source/

JTA and Resouce_Local setup

2009-07-27 Thread brobbsnet
I have object structure like this in my project. I have a SessionBean around a jpa entity like this. Jpa: Person--Customer---Invoices(Collection)---Data when i run a test on persistence.xml in Resouce_Local it works fine as finding a person returns the entire structure including the collection of

Re: MappingTool create index fails

2009-07-27 Thread Diane J
FIXED: I had to tell H2 not to close with ;DB_CLOSE_DELAY=-1: bean id=dataSource class=org.springframework.jdbc.datasource.DriverManagerDataSource property name=driverClassName value=org.h2.Driver / property name=url

Re: enhancing entity which is a subclass

2009-07-27 Thread Rick Curtis
After looking at the spec, it looks like you should be using the mapped-superclass XML descriptor on the UserModelBaseImpl class and com.example.model.impl.UserModelImpl needs to be added to your list of persistent classes. See section 2.11 - 'Inheritance' for more details. Let me know how it

Very weird enhancement error - is the class enhanced or not? - OpenJPA seems confused

2009-07-27 Thread C N Davies
I am getting a very strange error when calling persist/merge on my entity under only one specific case. Basically I have a User entity and a UserProfile Entity. The User entity has a one to one mapping to the UserProfile entity. This is all working fine. I have a Country entity, a Locale

RE: Very weird enhancement error - is the class enhanced or not? - OpenJPA seems confused

2009-07-27 Thread Ravi Palacherla
Hi, What are the values passed inside com.trm.jpa.services.EntityService.find(EntityService.java:80) while calling entitymanager.find() ? Thanks, Ravi. -Original Message- From: C N Davies [mailto:c...@cndavies.com] Sent: Monday, July 27, 2009 2:40 PM To: users@openjpa.apache.org

RE: Very weird enhancement error - is the class enhanced or not? - OpenJPA seems confused

2009-07-27 Thread C N Davies
Hi Ravi, Here is what gets executed: public Object find(Object co, String uid) { Class clazz = co.getClass(); Object existing = em.find(clazz, uid); return existing; } EM is an instance of the Entity Manager, but since tis

RE: Very weird enhancement error - is the class enhanced or not? - OpenJPA seems confused

2009-07-27 Thread Ravi Palacherla
Hi Chris, This exception can be seen if co.getClass() returns Class.class. You can may be print clazz before e.find() to see if it is correct. Once it is confirmed, then we can try to isolate the reason for why co.getClass() returns Class only for a country and not for other entities. Are you

Re: inconsistent SQL's RESOURCE_LOCAL Vrs JTA

2009-07-27 Thread Ravi P Palacherla
Hi, My guess is that the SQL generation should not be different between JTA and RESOURCE_LOCAL. Can you please add default trace level logging to both the scenarios and attach the logs here. That way we can compare between both scenarios and find if there are any differences in the properties