JoinTable « Map « JPA Q&A





1. Fetching join using @JoinTable with SQLQuery    stackoverflow.com

I have a mapped entity with a property "latestHistory", which is mapped through a join table, like:

class Record {

  @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, optional ...

2. Using Restrictions.disjunction over @JoinTable association    stackoverflow.com

This is similar, but not identical, to: http://stackoverflow.com/questions/1528352/hibernate-criteria-query-on-different-properties-of-different-objects I have a SpecChange record, which has a set of ResponsibleIndividuals; these are User records mapped by a hibernate join-table association. I want to ...

3. Does @JoinTable has a property of "table" or not?    stackoverflow.com

The following is copied from hibernate's document. (http://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/#d0e2770)

   @CollectionOfElements
    @JoinTable(
            table=@Table(name="BoyFavoriteNumbers"),
     ...

4. Hibernate @JoinTable issue    stackoverflow.com

I have a strange issue with Hibernate 3.5 which I hope some one can help me with. Context:

  • A FAC has zero or more "core" SECT's.
  • A FAC has zero or more "related" SECT's.
  • A ...

5. JPA "@JoinTable" annotation    stackoverflow.com

In which case do you use JPA @JoinTable annotation?

6. @JoinTable with WHERE    stackoverflow.com

Trying to implement a solution to this question I'm wondering, is there any way to have a WHERE clause when using the @JoinTable annotation. If you look at the question ...

7. JPA @JoinTable    forums.netbeans.org

Posted: Mon Jan 05, 2009 5:58 am Post subject: JPA @JoinTable Hi there, I'm using NB 6.5 and Glassfish V2. All Entities were generated from my DB and the SessionBeans were generated from the Entities using the respective wizards. I'm experiencing a problem with updating tables which consist of primary keys of two other tables. The generated Entities ...

8. Fetching join using @JoinTable with SQLQuery    forum.hibernate.org

class Record { @OneToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, optional = true) @JoinTable(name = "latest_history_join_view", joinColumns = { @JoinColumn(name = "record_id") }, inverseJoinColumns = { @JoinColumn(name = "history_id") }) @AccessType("field") ...

9. @JoinTable requires the entity to be Serializable?    forum.hibernate.org

Hello: I have an entity that was not implementing the Serializable interface. I started to use the @JoinTable annotation as part of a new ManyToMany mapping. It seems like the @JoinTable requires my entity to implement Serializable interface, otherwise it throws some sort of ClassCastException. Anyone has any idea why does it require so? I cannot really make this entity to ...





10. @JoinTable results in redundant join in the generated SQL    forum.hibernate.org

An Account can have several Clients: @Entity @Table(name = "CLIENT") public class Client implements Serializable { private String street; private String code; private String city; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @ManyToOne @JoinTable(name = "CLIENT_ACCOUNT", joinColumns = {@JoinColumn(name = "FK_CLIENT", referencedColumnName = "ID")}, inverseJoinColumns = {@JoinColumn(name = "FK_ACCOUNT", referencedColumnName = "ID")}) private Account account; ..... } @Entity @Table(name = "ACCOUNT") ...

11. @JoinTable with multiple JoinColumns    forum.hibernate.org

12. How to design a @JoinTable with conditions    forum.hibernate.org

I have employee, role and empRoleMap. I have mapped them together - [code] public class Employee { @Id private EmployeePK id; @ManyToOne @JoinTable( schema = "PROJECT", name = "EMP_ROLE_MAP", joinColumns = {@JoinColumn(name = "EMP_ID"),@JoinColumn(name = "EMP_ID_KEY")}, inverseJoinColumns = {@JoinColumn(name = "ROLE_CD"),@JoinColumn(name = "ROLE_CD_KEY")} ) private Role role; ..... [/code] The problem I have is that the empRoleMap has multiple records with ...

13. @ManyToMany and @JoinTable delete    forum.hibernate.org

Hi I have an object call user which has a list of attribute as its property: @Entity(name = "User") @Table(name = "tz_user") Code: public class User{ private Long userId; private Set attributes; @ManyToMany(fetch = FetchType.LAZY, cascade = {javax.persistence.CascadeType.DETACH}) @Cascade({CascadeType.DELETE_ORPHAN, CascadeType.SAVE_UPDATE}) @JoinTable(name = "tz_userattributes", ...

14. JPA @JoinTable creating rouge constraint    forum.hibernate.org