Search in sources :

Example 26 with SqlIdentifier

use of org.springframework.data.relational.core.sql.SqlIdentifier in project spring-data-jdbc by spring-projects.

the class SqlIdentifierUnitTests method unquotedSimpleObjectIdentifier.

// DATAJDBC-386
@Test
public void unquotedSimpleObjectIdentifier() {
    SqlIdentifier identifier = unquoted("someName");
    String sql = identifier.toSql(BRACKETS_LOWER_CASE);
    assertThat(sql).isEqualTo("someName");
    assertThat(identifier.getReference(BRACKETS_LOWER_CASE)).isEqualTo("someName");
}
Also used : SqlIdentifier(org.springframework.data.relational.core.sql.SqlIdentifier) Test(org.junit.jupiter.api.Test)

Example 27 with SqlIdentifier

use of org.springframework.data.relational.core.sql.SqlIdentifier in project spring-data-jdbc by spring-projects.

the class SqlIdentifierUnitTests method unquotedMultipartObjectIdentifier.

// DATAJDBC-386
@Test
public void unquotedMultipartObjectIdentifier() {
    SqlIdentifier identifier = SqlIdentifier.from(unquoted("some"), unquoted("name"));
    String sql = identifier.toSql(IdentifierProcessing.ANSI);
    assertThat(sql).isEqualTo("some.name");
}
Also used : SqlIdentifier(org.springframework.data.relational.core.sql.SqlIdentifier) Test(org.junit.jupiter.api.Test)

Aggregations

SqlIdentifier (org.springframework.data.relational.core.sql.SqlIdentifier)27 Test (org.junit.jupiter.api.Test)13 Nullable (org.springframework.lang.Nullable)4 HashMap (java.util.HashMap)2 Table (org.springframework.data.relational.core.sql.Table)2 Lazy (org.springframework.data.util.Lazy)2 Objects (java.util.Objects)1 Optional (java.util.Optional)1 PersistentProperty (org.springframework.data.mapping.PersistentProperty)1 PersistentPropertyPath (org.springframework.data.mapping.PersistentPropertyPath)1 MappingContext (org.springframework.data.mapping.context.MappingContext)1 BasicPersistentEntity (org.springframework.data.mapping.model.BasicPersistentEntity)1 IdentifierProcessing (org.springframework.data.relational.core.sql.IdentifierProcessing)1 TypeInformation (org.springframework.data.util.TypeInformation)1 Assert (org.springframework.util.Assert)1 StringUtils (org.springframework.util.StringUtils)1