@SuppressWarnings({"rawtypes", "unchecked"})
    private SingularAttribute<?,?> getIdProperty(EntityType entity) {
        final Set<SingularAttribute> singularAttributes = entity.getSingularAttributes();
        for (final SingularAttribute singularAttribute : singularAttributes) {
            if (singularAttribute.isId()) {
                return singularAttribute;
            }
        }
        return null;
    }
{@code JPQLSerializer} serializes Querydsl expressions into JPQL syntax.

@author tiwe
querydsl-jpa/src/main/java/com/querydsl/jpa/JPQLSerializer.java