Performance issue with new polymorphism implementation

Hi guys I’ve upgraded the hibernate version of my application to te version 6.4.1, but now cause of this I’m having a huge issue of performance when the entity retrieve the values.
My field of the table was like this in the hibernate 5 version:

 @SuppressWarnings("JpaAttributeTypeInspection")
    @ManyToAny(metaColumn = @Column(name = "property_type"), fetch = FetchType.LAZY)
    @Fetch(FetchMode.SELECT)
    @BatchSize(size = 500)
    @AnyMetaDef(
            idType = "integer", metaType = "string",
            metaValues = {
                    @MetaValue(targetEntity = PropertyText.class, value = "TEXT"),
                    @MetaValue(targetEntity = PropertyNumeric.class, value = "NUMERIC"),
                    @MetaValue(targetEntity = PropertyNumericRange.class, value = "NUMERIC_RANGE"),
                    @MetaValue(targetEntity = PropertyString.class, value = "STRING"),
                    @MetaValue(targetEntity = PropertyDate.class, value = "DATE"),
                    @MetaValue(targetEntity = PropertyDateRange.class, value = "DATE_RANGE"),
                    @MetaValue(targetEntity = PropertySet.class, value = "SET"),
                    @MetaValue(targetEntity = PropertyCodeName.class, value = "CODE_NAME"),
                    @MetaValue(targetEntity = PropertyBand.class, value = "BAND"),
                    @MetaValue(targetEntity = PropertyBandSeason.class, value = "BAND_SEASON"),
                    @MetaValue(targetEntity = PropertyRef.class, value = "REF"),
                    @MetaValue(targetEntity = PropertyComposite.class, value = "COMPOSITE"),
                    @MetaValue(targetEntity = PropertyRepositoryRef.class, value = "REPOSITORY"),
                    @MetaValue(targetEntity = PropertyKeyValue.class, value = "KEYVALUE")
            })
    @Cascade({ CascadeType.PERSIST,
               CascadeType.MERGE,
               CascadeType.SAVE_UPDATE})
    @JoinTable(
            name = "property_set_values",
            joinColumns = @JoinColumn(name = "set_id", referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name = "property_id", referencedColumnName = "id")
    )
    @OrderColumn(name = "property_order")
    @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
    private List<T> values = new ArrayList<>();

@SuppressWarnings("JpaAttributeTypeInspection")
    @ManyToAny(fetch = FetchType.LAZY)
    @Fetch(FetchMode.SELECT)
    @BatchSize(size = 500)
    @AnyDiscriminator(DiscriminatorType.STRING)
    @AnyDiscriminatorValue(discriminator = "TEXT", entity = PropertyText.class)
    @AnyDiscriminatorValue(discriminator = "NUMERIC", entity = PropertyNumeric.class)
    @AnyDiscriminatorValue(discriminator = "NUMERIC_RANGE", entity = PropertyNumericRange.class)
    @AnyDiscriminatorValue(discriminator = "STRING", entity = PropertyString.class)
    @AnyDiscriminatorValue(discriminator = "DATE", entity = PropertyDate.class)
    @AnyDiscriminatorValue(discriminator = "DATE_RANGE", entity = PropertyDateRange.class)
    @AnyDiscriminatorValue(discriminator = "SET", entity = PropertySet.class)
    @AnyDiscriminatorValue(discriminator = "CODE_NAME", entity = PropertyCodeName.class)
    @AnyDiscriminatorValue(discriminator = "COMPOSITE", entity = PropertyComposite.class)
    @AnyDiscriminatorValue(discriminator = "KEYVALUE", entity = PropertyKeyValue.class)
    @AnyDiscriminatorValue(discriminator = "BAND", entity = PropertyBand.class)
    @AnyDiscriminatorValue(discriminator = "BAND_SEASON", entity = PropertyBandSeason.class)
    @AnyDiscriminatorValue(discriminator = "REF", entity = PropertyRef.class)
    @AnyDiscriminatorValue(discriminator = "REPOSITORY", entity = PropertyRepositoryRef.class)
    @AnyKeyJavaClass(Integer.class)
    @Cascade({ CascadeType.PERSIST,
            CascadeType.MERGE,
            CascadeType.SAVE_UPDATE})
    @JoinTable(
            name = "property_set_values",
            joinColumns = @JoinColumn(name = "set_id", referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name = "property_id", referencedColumnName = "id")
    )
    @Column(name = "property_type")
    @OrderColumn(name = "property_order")
    @NotAudited
    private List<T> values = new ArrayList<>();

Do you see any problem with the changes done? Thanks in advance.

Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.