Search code examples
spring-dataspring-data-jdbc

How get entity class type from sub aggregation Set collection


I realize custom repository and try because we use Spring Data Jdbc 2.7 which is not supporting InsertOnlyProperty and in SQL generation I try to get class of sub aggregation for using in context.getRequiredPersistentEntity. How can I get it from RelationalPersistentProperty?


Solution

  • How can i get it from RelationalPersistentProperty?

    getComponentType()

    As the documentation says:

    Returns the component type of the type if it is a Collection. Will return the type of the key if the property is a Map.