CollectionTable « Map « JPA Q&A





1. @ElementCollection, @CollectionTable and Enum - Strange delete/insert behavior    stackoverflow.com

@Entity
public class User{

    @ElementCollection
    @Enumerated(EnumType.STRING)
    @CollectionTable(name = "SEC_USER_ROLES",
    joinColumns =
    @JoinColumn(name = "USER_ID", referencedColumnName = "ID"))
 ...

2. Problem with @CollectionTable in 3.5.1    forum.hibernate.org

I've encountered a problem that may be a hibernate collection bug. Using the code listed below, I'm creating collection table that has two columns: TERRITORY_ID and characters_CHARACTER_ID. When hibernate creates the table, it creates the following indexes: 1. An compound unique index on TERRITORY_ID and characters_CHARACTER_ID, which is expected. 2. A non-unique on both TERRITORY_ID and characters_CHARACTER_ID, which is expected. 3. ...