I am quite proficient with SQL and Java but only starting with JPA/Hibernate.
I have a database table that stores some media clips. It might be a sound, image or both. The media itself is stored in BLOB column and each clip has a name and type (single character column). So, I created an abstract class Clip with following annotations:
Code:
@MappedSuperclass
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "CLIP_TYPE", discriminatorType = DiscriminatorType.CHAR)
My concrete classes have @DiscriminatorValue equal to "S" or "I" respectively, but they do not have type attribute.
Now I want to select all sound clips.
I know how to do it in native SQL but cannot figure out how to do it in JPQL.
Can someone please help me with that?
Thanks.