I first thought its a Spring Data issue but I was wrong. (see https://jira.spring.io/browse/DATAJPA-1146) I have an entity hierarchy with single table inheritance. Base Class is "Carrier.java". The table is called "carrierjpa". The failing method tries to update a property but only for a special subtype.
entityManager.createQuery("update Carrier c set c.propertyx = ?1 where TYPE(c) = ?2 and c.propertyx is null").setParameter(1, new Date()).setParameter(2, subClassOfCarrier.class).executeUpdate();
This fails and generates a wrong a sql like
update carrierjpa set propertyx='2017-07-18 11:24:16.4' where carrier0_.ctype='subclassdiscriminator' and (propertyx is null)
So I think carrier0_ must be omitted here or added after carrierjpa |