MapKey « Map « JPA Q&A

1. How to use @MapKey annotation with 2 levels?

this question is similar to this other question I've asked, but slightly different. I have this:

class A{

  private List<B> bs;


class B{

  private Long id;
  private C ...

2. Eclipselink @mapkey and @JoinFetch(JoinFetchType.OUTER) cannot co-exist?

In entity class, i had below code:

@OneToMany(cascade = CascadeType.ALL, mappedBy = "customer", fetch = FetchType.EAGER)
@MapKey(name = "key")
private Map<String, CustomerSuppInfo> suppInfoMap....
find out that when i query the customer entity, the SQL ...

3. Hibernate storing maps using @MapKey annotation

Following these examples, because @MapKey and @MapKeyManyToMany in hibernate is deprecated, I tryed to figure out this case, with no sucess: taskAssignationState

protected Map<User, Boolean> usersState;

4. Removing @MapKey causes MappingException? Why?

Thanks, that's removing the mapping exception, but raises a PSQLException. Code: org.postgresql.util.PSQLException: ERROR: column map0_.map_key does not exist See below for full listing. May be I have to recreate the whole db-schema to get rid of this? Thanks. Greetings Michael Code: ERROR de.zew.vitax.database.TransactionManager - could not initialize a collection batch: [<69042, 68830, 68942, 68925, 68844, 68802, 68879, 68961, 69010, 68814>] ...

5. JPA + Hibernate + ManyToMany and @MapKey problem

Hi, Reading the book writen by Anthony PATRICIO: Java Persistence and Hibernate, There is a ManyToMany association management that matches my needs, ie: - With additional columns in the association table. - The association between the parent table and the table of association is a composition. The following example from the book: Code: // [Coach]<> ----> *[Season]* ----> [Team] // ...

7. best practices for @MapKey

Hi there, I am using the @MapKey annotation to create a map of "properties" for an object and I wanted to have feedback on any best practices. Searching the web and hibernates books yield not result. What I have basically is an ITEM table with a one to many relationship on a PROPERTY table. The property defines basically a name (String) ...

8. [JPA] @MapKey or what?

9. [Solved] Hibernate Annotations @MapKey

10. @MapKey("property.subProperty")

Hi folks. I'm trying to use the @MapKey in the following way: Code: @Entity public class Image { ... @OneToMany(mappedBy = "image") @MapKey(name = "") private Map properties = new Hash Map (); .... } @Entity public class ...