The IS OF TYPE predicate is used to test the type of an Enterprise JavaBeans (EJB) reference. It is similar in function to the Java instance of operator.
identification-variable IS OF TYPE ( [ONLY] type-1, [ONLY] type-2, ..... )
Suppose that bean ManagerBean is defined as a subtype of EmpBean and ExecutiveBean is a subtype of ManagerBean in an EJB inheritance hierarchy.
SELECT OBJECT(e) FROM EmpBean e
SELECT OBJECT(e) FROM EmpBean e WHERE e IS OF TYPE( ONLY EmpBean )
SELECT OBJECT(e) FROM EmpBean e WHERE e IS OF TYPE( ManagerBean)The above query is equivalent to the following query:
SELECT OBJECT(e) FROM ManagerBean e
SELECT OBJECT(e) FROM EmpBean e WHERE e IS OF TYPE( ONLY ManagerBean)or:
SELECT OBJECT(e) FROM ManagerBean e WHERE e IS OF TYPE (ONLY ManagerBean)