persistence@glassfish.java.net

RE: The entity class must be a top-level class.

From: Mike Keith <michael.keith_at_oracle.com>
Date: Tue, 14 Feb 2006 10:02:41 -0500

Sahoo,

This is version 1.0 of the Java Persistence API and nested static classes was not deemed to be a significant enough use case to spend spec time on. Certainly not in the 90% use cases that the spec was targetting for this release.

-Mike

> -----Original Message-----
> From: Sanjeeb.Sahoo_at_Sun.COM [mailto:Sanjeeb.Sahoo_at_Sun.COM]On Behalf Of
> Sanjeeb Kumar Sahoo
> Sent: Tuesday, February 14, 2006 9:09 AM
> To: persistence_at_glassfish.dev.java.net; Mike Keith
> Subject: The entity class must be a top-level class.
>
>
> Hi Mike,
>
> section 2.1 says:
> /The entity class must be a top-level class./
>
> Going by this rule, the following example is wrong.
> public class Foo {
> @Entity public static class Bar {
> }
> }
>
> Just curious as to why a public static nested class can't be an enity.
>
> Thanks,
> Sahoo
>