Search in sources :

Example 1 with AggregateReference

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

the class BasicRelationalConverterAggregateReferenceUnitTests method convertsToAggregateReference.

// DATAJDBC-221
@Test
public void convertsToAggregateReference() {
    final RelationalPersistentProperty property = entity.getRequiredPersistentProperty("reference");
    Object readValue = converter.readValue(23, property.getTypeInformation());
    Assertions.assertThat(readValue).isInstanceOf(AggregateReference.class);
    assertThat(((AggregateReference<DummyEntity, Long>) readValue).getId()).isEqualTo(23L);
}
Also used : AggregateReference(org.springframework.data.jdbc.core.mapping.AggregateReference) RelationalPersistentProperty(org.springframework.data.relational.core.mapping.RelationalPersistentProperty) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 AggregateReference (org.springframework.data.jdbc.core.mapping.AggregateReference)1 RelationalPersistentProperty (org.springframework.data.relational.core.mapping.RelationalPersistentProperty)1