Re: Unnecesery INNER JOIN

2010-07-15 Thread Patrick Linskey
Hi, This sounds like it might be another manifestation of https://issues.apache.org/jira/browse/OPENJPA-1711 -Patrick On Jul 15, 2010, at 2:41 PM, Russell Collins wrote: > From the looks of what you have in your query, there has to be a join of some > kind. You are trying to get the "id" of

RE: Unnecesery INNER JOIN

2010-07-15 Thread QkI
>From my point of view, there shouldn't be any joins and correct SQL output should look like: SELECT b.a_id FROM table_b b WHERE b.id = 123 I try to limit unnecesery joins in my queries, because in the case of pessimistic locking this behavoiur locks too much. By the way previously I was using h

RE: EXTERNAL: Re: PersistenceUnit null not found

2010-07-15 Thread Totsline, Greg
Try changing your PersistenceContext injection attribute from "name" to "unitName" to refer to your persistence unit. -greg -Original Message- From: Michael Dick [mailto:michael.d.d...@gmail.com] Sent: Thursday, July 15, 2010 2:58 PM To: users@openjpa.apache.org; us...@openejb.apache.org

RE: Unnecesery INNER JOIN

2010-07-15 Thread Russell Collins
>From the looks of what you have in your query, there has to be a join of some >kind. You are trying to get the "id" of class "A" that is associated with >class "B". If this is not your desire, what are you trying to do? -Original Message- From: QkI [mailto:kukis...@gmail.com] Sent: Th

Re: Date Problem

2010-07-15 Thread jingmeifan
>Sorry, I am afraid I cannot. Without at minimum a snippet of code it's pretty hard to help you out. - Sorry again, right now detachCopy method of OpenJPAEntityManager can solve my problem. > Would you please let me know what bug on detachCopy method? I'm not sure what you're asking here. -

Re: Date Problem

2010-07-15 Thread Rick Curtis
>Sorry, I am afraid I cannot. Without at minimum a snippet of code it's pretty hard to help you out. > Would you please let men know what bug on detachCopy method? I'm not sure what you're asking here. > if I get em from jpaTample, and from em find data, do I need always close em after? I'm not s

Re: PersistenceUnit null not found

2010-07-15 Thread Michael Dick
Nothing else is jumping out at me so I'm cross-posting to us...@openejb. I'm not sure what PersistenceUnit 'null' means in this context - they might be able to shed some light on the message though. -mike On Thu, Jul 15, 2010 at 10:01 AM, Michael Simons wrote: > Hello Mike, > > It's in the META

Re: Date Problem

2010-07-15 Thread jingmeifan
Hi Rick, Sorry, I am afraid I cannot. Would you please let men know what bug on detachCopy method? And one more question, if I get em from jpaTample, and from em find data, do I need always close em after? Thanks, Jane -- View this message in context: http://openjpa.208410.n2.nabble.com/Date-

Re: Date Problem

2010-07-15 Thread Rick Curtis
Hmm, can you post a small unit test? Thanks, Rick

Re: Date Problem

2010-07-15 Thread jingmeifan
Sorry, I mean the entity didn't been detached. -- View this message in context: http://openjpa.208410.n2.nabble.com/Date-Problem-tp2943310p5298472.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Unnecesery INNER JOIN

2010-07-15 Thread QkI
Hi, Let's say I have the following persistence class: @Entity public class B { @OneToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) @JoinColumn(name = "a_id") private A a; } and when I try to execute this JPA query: SELECT b.a.id FROM B where B.id = 123 my SQL output looks li

Re: Date Problem

2010-07-15 Thread jingmeifan
I tried changing version=2.0, and using detach on em, but the entity still did detached. :( http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="2.0"> This is the only place to change the version, where am I still miss

Re: PersistenceUnit null not found

2010-07-15 Thread Michael Simons
Hello Mike, It's in the META-INF directory of the ejb.jar that I deploy. We are deploying to a Geronimo AS (2.1.4) that uses openejb-3.0.1. Might this have been a bug in that version that has been solved since then. Regards, Michael Michael Dick schrieb: > Hi, > > Where is the persistence.xml

Re: Date Problem

2010-07-15 Thread Rick Curtis
Try changing version="1.0" to version="2.0" and removing don't use the detachCopy method. I think that this is a bug that I reported [1] a while back. Thanks, Rick [1] https://issues.apache.org/jira/browse/OPENJPA-1672

Re: Date Problem

2010-07-15 Thread jingmeifan
Thanks Rick for your responding, do you mean there is any configuration in persistence.xml? My file is very simple: http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="1.0"> org.apache.openjpa.persistence

Re: Date Problem

2010-07-15 Thread Rick Curtis
Can you post your persistence.xml file? Thanks, Rick

Re: PersistenceUnit null not found

2010-07-15 Thread Michael Dick
Hi, Where is the persistence.xml file in your ejb.jar? It should be in the META-INF directory. The container will look for persistence.xml files in the following places (per JPA spec): In Java EE environments, the root of a persistence unit must be one of the following: • an EJB-JAR file • the WE

Re: Date Problem

2010-07-15 Thread jingmeifan
Hi Rick, I solved this problem by casting the EntityManger to OpenJPAEntityManager and using detachCpoy method which it return detached entity. Properly detach method is a bug need fix. Thanks, Jane -- View this message in context: http://openjpa.208410.n2.nabble.com/Date-Problem-tp2943310p529

PersistenceUnit null not found

2010-07-15 Thread Michael Simons
Hello, I've declared a persistence-unit named "AtlantisWest" in my persistence.xml, that I reference in my bean by @PersistenceContext(name="AtlantisWest", type=PersistenceContextType.EXTENDED) protected EntityManager entityManager; Can anybody please tell me what might cause the fo

Re: Creating a custom L2 cache

2010-07-15 Thread Kevin Sutter
http://ehcache.org/documentation/openjpa_provider.html On Wed, Jul 14, 2010 at 9:09 PM, Rick Curtis wrote: > This is something that I've always wanted to experiment with, just have > never found the time. AFIK, OpenJPA proper doesn't have support for a > shared > cache but you could use the Open