Re: Timestamp in JPQL where clause issue

2009-07-28 Thread wang yu
Pinaki, Yes ,you're right. Thanks! Yu Wang On Mon, Jul 27, 2009 at 8:32 PM, Pinaki Poddar wrote: > > 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. > > > > - >

Re: Type of query's result

2009-07-28 Thread Craig L Russell
Hi, If what you want is the result as an A with some number of fields populated, you can use a fetch plan with a fetch group that calls for just the fields that you need. In my experience, there is not much performance difference between fetching 1 primitive field versus 10 primitive fiel

Type of query's result

2009-07-28 Thread Jean-Baptiste BRIAUD -- Novlog
Hi, If I use the following request SELECT a FROM A a, I got a List witch is perfectly fine. If I use SELECT a.attribute1, a.attribute2 FROM A a, I got a List where each List element is an array of 2 values for attribute1 and attribute2. How can I have a List where only attribute1 and attr

Re: Type of query's result

2009-07-28 Thread Jean-Baptiste BRIAUD -- Novlog
OK, that will solve from 40 to 60% of my problem :-) In fact, if I understood correctly, this need a specific constructor. When request is static, it solve the problem. But when the request is dynamic (the request's string provided at runtime) I can't provide the corresponding constructor at ru

Re: EntityManager in Application Server Clusters

2009-07-28 Thread Pinaki Poddar
> I implemented a Session Bean, if the bean is stateless, it will result into frequent construction of EMF . > Which good practise do you propose? construction of EMF is 'heavy' operation. You should avoid it all cost. Implement a mechanics where EMF is created only once during the lifetime of a

Re: update an remove in distributed environments

2009-07-28 Thread Pinaki Poddar
merge() returns the updated or 'merged' instance. So please try this and see if that works... public void remove(Object entity) { try { EntityManager em = this.getEm(); Object merged = em.merge(entity); em.remove(merged); } catch (Thr

Re: Type of query's result

2009-07-28 Thread Luis Fernando Planella Gonzalez
Use select new A(a.attribute1, a.attribute2) from A a Create a constructor to accommodate the received parameters. Em Terça-feira 28 Julho 2009, às 15:27:31, Jean-Baptiste BRIAUD -- Novlog escreveu: > Hi, > > If I use the following request SELECT a FROM A a, I got a List > witch is perfectly f

Type of query's result

2009-07-28 Thread Jean-Baptiste BRIAUD -- Novlog
Hi, If I use the following request SELECT a FROM A a, I got a List witch is perfectly fine. If I use SELECT a.attribute1, a.attribute2 FROM A a, I got a List where each List element is an array of 2 values for attribute1 and attribute2. How can I have a List where only attribute1 and attr

update an remove in distributed environments

2009-07-28 Thread Scherer, Annette
Hello, I am using OpenJPA in a client/server environment. I need to persist, find or query an object, update it and remove it. How can I do this? As explained in OpenJPA's Manual Part 2, Chapter 8.2, I tried to merge the object bevor removing it. But this doesn work. This is my example: Clien

EntityManager in Application Server Clusters

2009-07-28 Thread Scherer, Annette
Hello, I use OpenJPA in a distributed J2EE Environment. I implemented a Session Bean, which lazy creates EntityManager and EntityManager Factory: private EntityManager getEm() { if (this.em == null) { this.em = this.getEmf().createEntityManager(); } retu

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

2009-07-28 Thread C N Davies
Hi Ravi, I don't get this issue the first time I persist the UserProfile, only subsequent times I call merge. I added the logging as you suggested and the result is puzzling. I have a value changed listener on my jsf page, and it is this is the code that calls the find method. Here is what my outp