> Could you elaborate?

You should put the @IdClass annotation in the same class as the @Id
fields are declared. So, in your example, in the @MappedSuperclass or
@Entity.

FYI, I just switched your classes back to using @MappedSuperclass -- the
subtypes were specified to use single-table inheritance, and table names
were also specified in the mapped superclasses, causing a mapping error.
I've had to make a couple of other changes to get things running; I'll
send more info soon.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc.
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: tbee [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, April 25, 2007 1:06 AM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: Open JPA error-Could not locate metadata for the 
> class using alias
> 
> 
> 
> 
> Patrick Linskey wrote:
> > 
> > Ok... the problem is that OpenJPA requires that you run the OpenJPA 
> > class enhancer over your classes (or run in a container environment 
> > such as an appserver or Spring, which can do 
> class-load-time processing).
> > 
> > The other problem is that the error message is really bad, 
> in that it 
> > doesn't suggest that as a cause, and in that the message 
> > stringification is deferred, causing the "Article=null" 
> negative-cache misdirection.
> > I've changed the error message and toString() logic.
> > 
> > Meanwhile, I got the following when running the enhancer on your
> > classes:
> > 
> > <0.0.0 fatal user error> org.apache.openjpa.util.MetaDataException:
> > "nl.reinders.bm.generated.License.iLicensenr" declares 
> generator name 
> > "licensenr", but uses the AUTO generation type.  The only valid 
> > generator names under AUTO are "uuid-hex" and "uuid-string".
> > 
> > I changed the @GeneratedValue annotation to specify that it's using 
> > the 'GenerationType.TABLE' strategy, but then I ran into 
> problems with 
> > classes that had compound identity but didn't specify an @IdClass.
> > 
> 
> 
> Ok, the first part I get; actually very logical. 
> 
> The generator I follow also, I should alter the RevEng to 
> generate type=table. Ok. But the compound identity I'm not 
> quite following. If all is well then I should be generating 
> "*PK.java" classes for tables with more than one field in the 
> PK and the corresponding @IdClass. Maybe the quick change to 
> "@Entity extends @Entity" has a bug, now that I think of it, 
> the @IdClass may refer to a PK class that actually is in the 
> generated package.
> Could you elaborate?
> 
> --
> View this message in context: 
> http://www.nabble.com/Open-JPA-error-Could-not-locate-metadata
> -for-the-class-using-alias-tf3561516.html#a10176178
> Sent from the open-jpa-dev mailing list archive at Nabble.com.
> 
> 

Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

Reply via email to