InheritanceType « Map « JPA Q&A

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

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

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

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

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

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

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

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

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

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

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

I have a simple JOINED hierarchy of documents:

  discriminator ENUM('official','individual','external') NOT NULL,
  file_name VARCHAR(200) NOT NULL,

CREATE SystemDocuments

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

I have two entities - and 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

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 = :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 ...