InheritanceType « Map « JPA Q&A





1. JPA one-to-many association to an entity with @Inheritance(strategy=InheritanceType.JOINED)    stackoverflow.com

Hallo all. I'm trying to map an association one-to-many to an entity that is mappes with @Inheritance(strategy=InheritanceType.JOINED)

....
@ManyToMany
@JoinTable(name = "S_MC_CC_CONTRATTIRAPPORTI",
    joinColumns = @JoinColumn(name = "COD_MULTICHANNELID"),
    inverseJoinColumns = ...

2. JPA @Inheritance(strategy = InheritanceType.JOINED): different discriminator value for same class    stackoverflow.com

Is it possibile to map two differents discriminator values to the same concrete java class? Something like this:

@DiscriminatorValue("4")
@DiscriminatorValue("5")
public class CartaImpl extends RapportoImpl implements Carta, Cloneable {
Another question: is it possible to have ...

3. JPA @Inheritance(strategy = InheritanceType.JOINED): Missing class for indicator field value    stackoverflow.com

Is it possible to have a default implementation when no class is provided for an indicator field value for not raising this exception?

Missing class for indicator field value 
Kind regards Massimo ...

4. JPA - InheritanceType.Joined generates wrong tables    stackoverflow.com

I'm trying to represent in data base a editable table, with multiple field types. My approach looks like this:

TABLES
- uuid //Primary key
- cols
- rows
- name  

VALUE
-col //Key element 
-row //Key element
-parent ...

5. Hibernate 4: persisting InheritanceType.JOINED discriminator column values    stackoverflow.com

I have a simple JOINED hierarchy of documents:

CREATE TABLE Documents
(
  id INTEGER NOT NULL,
  discriminator ENUM('official','individual','external') NOT NULL,
  file_name VARCHAR(200) NOT NULL,
  PRIMARY KEY (id)
);

CREATE SystemDocuments
(
  ...

6. Please explain below queries in case of JPA @Inheritance(strategy=InheritanceType.JOINED)    coderanch.com

I have two entities - Product.java and Book.java. Book is extending Product and i have defiend inheritence as @Inheritance(strategy=InheritanceType.JOINED). As per my understanding, i will create two tables :- Product and Book. When i am trying to persist Book in the database using em.persist, it is inserting one record in Book as well as Product table. My question is that 1. ...

7. @Inheritance(strategy=InheritanceType.JOINED) and .class    forum.hibernate.org

Hi Everyone, I am trying to use the @Inheritance(strategy=InheritanceType.JOINED) annotation with this query: @NamedQuery(name="RbacRole.getPermissionsByType", query="select p " + "from RbacRole as role " + "join role.permissions as p " + "where role.pk = :pk and p.class = :clazz") when I execute the query I get the following exception: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer on the class property. When I ...