openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phill Moran" <>
Subject RE: Named query created in error
Date Thu, 19 Apr 2007 14:37:36 GMT
Thanks Jacek,

Store is annotated with @Entity:

@Table(name = "manufacturer", schema = "bidspec")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@NamedQueries( {
		@NamedQuery(name = "StoreFXPK", query = "SELECT s FROM Store s
WHERE = :primaryKey"),
		@NamedQuery(name = "StoreFXTypeAndName", query = "SELECT s FROM
Store s WHERE s.type = :type AND UPPER( = :storeName OR
UPPER(s.displayName) = :storeName"),
		@NamedQuery(name = "StoreFXName", query = "SELECT s FROM Store s
WHERE UPPER( = :storeName OR UPPER(s.displayName) = :storeName") })
public class Store extends Persistable {

I thought I needed to add the class names to persistence.xml to have them
post-processed. I recognized (since using java agent right now) they are all
looked at for persistence candidacy but figured this would be needed for compile
time processing that I would switch to later. Let me know if I am way off here.
Also must I list all other classes in the <exclude-unlisted-classes> section or
can I simply list add <exclude-unlisted-classes/> after my listed classes. -
Clearly I am uncertain to the full purpose of this file

Thanks for all this support


-----Original Message-----
From: [] On Behalf Of Jacek Laskowski
Sent: April 19, 2007 10:15 AM
Subject: Re: Named query created in error

On 4/19/07, Phill Moran <> wrote:
> I am using MySQL version 5
> The stack trace only shows because  have wrapped this in a try/catch. 
> The exception becomes NPE due to  OpenJPA trying to make a Person 
> object form more than just Person Object data, it fails to do this 
> (silently) and the object it was to be assigned to become an NP

Could you make sure that the entity behind is really an entity? Is it
annotated with @Entity?

> Nothing in the persistence.xml except class names (all persistable 
> classes represented in here) and OpenJPA settings.
> Interesting questions on why the duplicate query exception suddenly 
> showing up,

It's because you use <class> and no <exclude-unlisted-classes> in
persistence.xml. You should either remove the <class> elements or add
<exclude-unlisted-classes> and the Ignoring. warning message should go away.


Jacek Laskowski

View raw message