-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow setting additional Hibernate quoting options
Deprecate the property `globally-quoted-identifiers` indicating to use `all-identifiers` in quoting options group. Now will be possible skip column definitions when enabling global quoting and automatically quote deemed keywords.
- Loading branch information
Showing
11 changed files
with
169 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
...loyment/src/test/java/io/quarkus/hibernate/orm/quoted_indentifiers/JPAQuotedTestCase.java
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
...loyment/src/test/java/io/quarkus/hibernate/orm/quoting_options/AbstractJPAQuotedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.quarkus.hibernate.orm.quoting_options; | ||
|
||
import static org.hamcrest.core.StringContains.containsString; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.restassured.RestAssured; | ||
|
||
public abstract class AbstractJPAQuotedTest { | ||
|
||
@Test | ||
public void testQuotedIdentifiers() { | ||
RestAssured.when().post("/jpa-test-quoted").then() | ||
.body(containsString("ok")); | ||
|
||
RestAssured.when().get("/jpa-test-quoted").then() | ||
.body(containsString("group_name"), containsString("group_value")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...ment/src/test/java/io/quarkus/hibernate/orm/quoting_options/JPAQuotedIdentifiersTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.quarkus.hibernate.orm.quoting_options; | ||
|
||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusDevModeTest; | ||
|
||
/** | ||
* Failed to fetch entity with reserved name and containing one column with reserved name and column definition. | ||
* <p> | ||
* To resolve the simulated situations, this test activates the quoting options {@code all-identifiers} and | ||
* {@code skip-column-definitions}. | ||
*/ | ||
public class JPAQuotedIdentifiersTest extends AbstractJPAQuotedTest { | ||
|
||
@RegisterExtension | ||
final static QuarkusDevModeTest TEST = new QuarkusDevModeTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(Group.class, QuotedResource.class) | ||
.addAsResource("application-quoted-identifiers.properties", "application.properties")); | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...loyment/src/test/java/io/quarkus/hibernate/orm/quoting_options/JPAQuotedKeywordsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.quarkus.hibernate.orm.quoting_options; | ||
|
||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusDevModeTest; | ||
|
||
/** | ||
* Failed to fetch entity with reserved name and containing one column with reserved name and column definition. | ||
* <p> | ||
* To resolve the simulated situations, this test activates the quoting option {@code auto-keywords}. | ||
*/ | ||
public class JPAQuotedKeywordsTest extends AbstractJPAQuotedTest { | ||
|
||
@RegisterExtension | ||
final static QuarkusDevModeTest TEST = new QuarkusDevModeTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(Group.class, QuotedResource.class) | ||
.addAsResource("application-quoted-keywords.properties", "application.properties")); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...nsions/hibernate-orm/deployment/src/test/resources/application-quoted-keywords.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
quarkus.datasource.db-kind=h2 | ||
quarkus.datasource.jdbc.url=jdbc:h2:mem:test | ||
|
||
#quarkus.hibernate-orm.log.sql=true | ||
quarkus.hibernate-orm.database.generation=drop-and-create | ||
|
||
quarkus.hibernate-orm.quote.auto-keywords=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters