File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
main/java/org/hibernate/boot/model/naming
test/java/org/hibernate/orm/test/mapping/autoquote Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ else if ( quoteOnNonIdentifierChar && !quote ) {
112112 else {
113113 for ( int i = start + 1 ; i < end ; i ++ ) {
114114 c = text .charAt ( i );
115- if ( !isLetterOrDigit ( c ) && c != '_' ) {
115+ if ( !isLetterOrDigit ( c ) && c != '_' && c != '$' ) {
116116 quote = true ;
117117 break ;
118118 }
Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-License-Identifier: LGPL-2.1-or-later
3+ * Copyright Red Hat Inc. and Hibernate Authors
4+ */
5+ package org .hibernate .orm .test .mapping .autoquote ;
6+
7+ import jakarta .persistence .Column ;
8+ import jakarta .persistence .Entity ;
9+ import jakarta .persistence .Id ;
10+ import org .hibernate .testing .orm .junit .EntityManagerFactoryScope ;
11+ import org .hibernate .testing .orm .junit .Jpa ;
12+ import org .junit .jupiter .api .Test ;
13+
14+ @ Jpa (annotatedClasses = SpecialCharactersTest .Simple .class )
15+ public class SpecialCharactersTest {
16+ @ Test void test (EntityManagerFactoryScope scope ) {
17+ scope .getEntityManagerFactory ();
18+ }
19+ @ Entity static class Simple {
20+ @ Id
21+ long id ;
22+ @ Column (name ="NAME$NAME" )
23+ String nameWithDollar ;
24+ @ Column (name ="$NAME" )
25+ String nameWithInitialDollar ;
26+ @ Column (name ="NAME#NAME" )
27+ String nameWithHash ;
28+ @ Column (name ="NAME NAME" )
29+ String nameWithSpace ;
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments