Skip to content

Commit 38fb68a

Browse files
committed
correctly describe automatic quoting in doc
1 parent d433133 commit 38fb68a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

documentation/src/main/asciidoc/introduction/Configuration.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,11 @@ We'll have more to say about them in <<naming-strategies>>.
503503
[[quoted-identifiers]]
504504
=== Quoting SQL identifiers
505505

506-
By default, Hibernate never quotes SQL table and column names in generated SQL.
506+
By default, Hibernate never quotes a SQL table or column name in generated SQL when the name contains only alphanumeric characters.
507507
This behavior is usually much more convenient, especially when working with a legacy schema, since unquoted identifiers aren't case-sensitive, and so Hibernate doesn't need to know or care whether a column is named `NAME`, `name`, or `Name` on the database side.
508+
On the other hand, any table or column name containing a punctuation character like `$` is automatically quoted by default.
508509

509-
The following settings enable automatic quoting:
510+
The following settings enable additional automatic quoting:
510511

511512
.Settings for identifier quoting
512513
[%breakable,cols="35,~"]

hibernate-core/src/test/java/org/hibernate/orm/test/annotations/collectionelement/QueryTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,15 @@ public void testMemberOfSyntax(SessionFactoryScope scope) {
5959
}
6060
);
6161
}
62+
63+
@Test
64+
@JiraKey(value = "HHH-14125" )
65+
public void testSelectElementCollectionProperty(SessionFactoryScope scope) {
66+
// Selecting property directly works for basic types and associated entities, should also work for ElementCollection
67+
scope.inSession(
68+
session -> {
69+
session.createQuery( "select e.someStrings from EntityWithAnElementCollection e" ).list();
70+
}
71+
);
72+
}
6273
}

hibernate-core/src/test/java/org/hibernate/orm/test/type/LocalDateTimeTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public static List<Object[]> data() {
9898
// This does not work, but it's unrelated to HHH-13379; see HHH-13515
9999
//.add( 2018, 9, 30, 2, 0, 0, 0, ZONE_AUCKLAND )
100100
.add( 2018, 9, 30, 3, 0, 0, 0, ZONE_AUCKLAND )
101+
.add( -1, 1, 1, 0, 0, 0, 0, ZONE_PARIS )
101102
.build();
102103
}
103104

0 commit comments

Comments
 (0)