As mentioned in this comment of the related issue’s original forum post, you can try passing something like new SqmExtractUnit<>( TemporalUnit.YEAR, ((NodeBuilder) criteriaBuilder).getIntegerType(), (NodeBuilder) criteria>Builder ) instead of criteriaBuilder.literal("year"). |