On Tue, May 26, 2009 at 4:51 PM, Pinaki Poddar <[email protected]> wrote:
> > Hi Mike, > > We could (should ?) scan the classpath if the alias isn't available and > > exclude-unlisted-classes == false. It could be expensive but it's better > > than a misleading error message like this one.. > > We should. Perhaps with a > openjpa.ScanClasspathForEntityWhenQueryAliasNotDetecetd=true|false. But > what > is the scope of such scan? And what exactly should be the strategy for a > fast scan? I'd guess this is why we don't do something like this already - it's not a trivial solution. I'd propose something like this (assuming the problem still exists after we fix the issue Michael Simons mentioned) : openjpa.UnlistedEntityDetection = none | complete | partial. none == behavior we have today. complete == scan all @Entities on the classpath (and anything in orm.xml). Exception as today if the alias is not found. partial == scan until we find the missing alias - then stop. Exception as today if the alias is not found. We've spoken about initializing the MetaDataRepository eagerly in the past (1 pass, avoid locking, re-scanning, etc.). This approach wouldn't be the same but it'd be related. Also do you know of any place in OpenJPA (or elsewhere) that employs a full > classpath scan? > Not off the top of my head. I would think that the PCEnhancer would do something similar if no classes were listed in persistence.xml though. -mike > > > Michael Dick wrote: > > > > Does listing the types in persistence.xml also resolve the problem? > > Specifying them on the MetaDataFactory should exercise the same path as : > > <persistence-unit name="xxx"> > > <class>net.uniopt.domain.actual.ActualAction</class> > > . . . > > </persistence-unit> > > > > Possible explanation (more for d...@openjpa than us...@openjpa) : > > Enhanced classes have a static initializer which "registers" the type > with > > OpenJPA the first time it's loaded (creating and instance or running > > em.find()). If the type isn't listed or initialized we don't know where > > look > > for the alias in your JPQL query. > > > > We could (should ?) scan the classpath if the alias isn't available and > > exclude-unlisted-classes == false. It could be expensive but it's better > > than a misleading error message like this one.. > > > > -mike > > > > On Tue, May 26, 2009 at 12:27 PM, Kevin Sutter <[email protected]> > wrote: > > > >> At least you have verified that the problem is related to the populating > >> of > >> the metadata repository. Thanks for the information. > >> > >> Kevin > >> > <snip> > > ----- > Pinaki Poddar http://ppoddar.blogspot.com/ > > http://www.linkedin.com/in/pinakipoddar > OpenJPA PMC Member/Committer > JPA Expert Group Member > -- > View this message in context: > http://n2.nabble.com/...-is-not-a-recognized-entity-or-identifier.-tp2969391p2977501.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. > >
