Simeon Angelov
Simeon Angelov

Reputation: 470

JPA/EclipseLink annotation for complex Map like : Map<String, List<String>>()

Is it possible to annotate a structure like :

via JPA or/and EclipseLink ?

If yeas, what's the SQL SCHEME (as tables) is generated applying it ?

Thanks, Simeon

Upvotes: 0

Views: 217

Answers (1)

James
James

Reputation: 18379

No this is not directly supported by JPA.

The best thing to do is to create an object/Entity that defines/maps to the relationship, which is normally a better model in general than a complex data structure.

See, http://en.wikibooks.org/wiki/Java_Persistence/Relationships#Nested_Collections.2C_Maps_and_Matrices

Upvotes: 4

Related Questions