Search in sources :

Example 16 with PersistentPropertyPathExtension

use of org.springframework.data.relational.core.mapping.PersistentPropertyPathExtension in project spring-data-jdbc by spring-projects.

the class JdbcIdentifierBuilderUnitTests method qualifiersForLists.

// DATAJDBC-326
@Test
public void qualifiersForLists() {
    PersistentPropertyPathExtension path = getPath("moreChildren");
    Identifier identifier = // 
    JdbcIdentifierBuilder.forBackReferences(converter, path, // 
    "parent-eins").withQualifier(path, // 
    "list-index-eins").build();
    // 
    assertThat(identifier.getParts()).extracting("name", "value", // 
    "targetType").containsExactlyInAnyOrder(// 
    tuple(quoted("DUMMY_ENTITY"), "parent-eins", UUID.class), // 
    tuple(quoted("DUMMY_ENTITY_KEY"), "list-index-eins", Integer.class));
}
Also used : SqlIdentifier(org.springframework.data.relational.core.sql.SqlIdentifier) PersistentPropertyPathExtension(org.springframework.data.relational.core.mapping.PersistentPropertyPathExtension) UUID(java.util.UUID) Test(org.junit.jupiter.api.Test)

Aggregations

PersistentPropertyPathExtension (org.springframework.data.relational.core.mapping.PersistentPropertyPathExtension)16 Test (org.junit.jupiter.api.Test)6 RelationalPersistentProperty (org.springframework.data.relational.core.mapping.RelationalPersistentProperty)5 BasicRelationalPersistentProperty (org.springframework.data.relational.core.mapping.BasicRelationalPersistentProperty)3 UUID (java.util.UUID)2 SqlIdentifier (org.springframework.data.relational.core.sql.SqlIdentifier)2 Nullable (org.springframework.lang.Nullable)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 JdbcIdentifierBuilder (org.springframework.data.jdbc.core.convert.JdbcIdentifierBuilder)1 PersistentPropertyPath (org.springframework.data.mapping.PersistentPropertyPath)1 DbAction (org.springframework.data.relational.core.conversion.DbAction)1 Column (org.springframework.data.relational.core.sql.Column)1 Expression (org.springframework.data.relational.core.sql.Expression)1 SelectBuilder (org.springframework.data.relational.core.sql.SelectBuilder)1 Table (org.springframework.data.relational.core.sql.Table)1 Part (org.springframework.data.repository.query.parser.Part)1 PartTree (org.springframework.data.repository.query.parser.PartTree)1