Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Nested class entities

Learning by doing!
...and read the Spec for e.g. Chapter 2.1(.5)

Are the classes AFoo and ABar really Entities with own tables?



Jaka Jančar wrote:
> 
> I'm not asking about @Embedded, but about @Entity. So:
> 
> @Entity
> class A {
>  @Entity
>  public static class AFoo implements XFoo {...}
>  @Entity
>  public static class ABar implements XBar {...}
> }
> 
> 
> They would not be embedded in the parent, but the parent would have a
> @OneToMany relationship to them. Since I would never use AFoo and ABar
> outside of A, I'd like to nest them.
> 
> Jaka
> 
> On Sat, May 16, 2009 at 7:51 PM, Joe Mc. <m_joe_c@xxxxxxxxxxx> wrote:
>>
>> Yes, Embeddable and Embedded are your friends ;-)
>>
>> Links:
>> http://wiki.eclipse.org/Introduction_to_EclipseLink_JPA_(ELUG)#.40Embeddable
>>
>> Codesnippet:
>>
>> @Entity
>> class A {
>>  @Id
>>  private Integer id;
>>
>>  @Embeddable
>>  public static class B {
>>
>>  }
>>
>>  @Embedded
>>  private B b;
>>
>> }
>>
>>
>>
>> Jaka Jančar wrote:
>>>
>>> Hi!
>>>
>>> Does JPA / EclipseLink support using @Entity on static nested classes?
>>>
>>> Jaka
>>> _______________________________________________
>>> eclipselink-users mailing list
>>> eclipselink-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Nested-class-entities-tp23575979p23576197.html
>> Sent from the EclipseLink - Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Nested-class-entities-tp23575979p23576530.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top