MapKey « Map « JPA Q&A





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

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?    stackoverflow.com

In Customer.java entity class, i had below code:

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

3. Hibernate storing maps using @MapKey annotation    stackoverflow.com

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;
@ManyToMany(
  ...

4. Removing @MapKey causes MappingException? Why?    forum.hibernate.org

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: [de.zew.vitax.tax.taxbase.shareholderAssetAndIncome.TaxBaseShareholderAssetOrIncome.map#<69042, 68830, 68942, 68925, 68844, 68802, 68879, 68961, 69010, 68814>] ...

5. JPA + Hibernate + ManyToMany and @MapKey problem    forum.hibernate.org

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] // Coach.java ...

7. best practices for @MapKey    forum.hibernate.org

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?    forum.hibernate.org

9. [Solved] Hibernate Annotations @MapKey    forum.hibernate.org





10. @MapKey("property.subProperty")    forum.hibernate.org

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