@Override
    public int compare(Property property1, Property property2) {
        Integer comparison = null;
        for (Property property : Arrays.asList(property1, property2)) {
            Map<Object, Object> data = property.getData();
            ColumnMetadata columnMetadata = (ColumnMetadata) data.get("COLUMN");
            int index = columnMetadata.getIndex();
            comparison = comparison == null ? index : comparison - index;
        }
        return comparison;
    }
Compares {@link Property} instances based on their ordinal position in the table
querydsl-sql-codegen/src/main/java/com/querydsl/sql/codegen/OrdinalPositionComparator.java