This is correct. If you query for a superclass, it can return any subclass that fits the query. You can just cast to the subclass and use instanceof to check what type it is. This is just what inheritance is in
Java.
There is a class discriminator (type) field defined in the root PRODUCT table, this is used to determine the type of object to build. If you only wanted instances of Product or some other class, you can use the TYPE() function in JPQL to check the type of the row.