forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
521 additions
and
19 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
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
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,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>quarkus-jaxp-parent</artifactId> | ||
<groupId>io.quarkus</groupId> | ||
<version>999-SNAPSHOT</version> | ||
<relativePath>../</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-jaxp-deployment</artifactId> | ||
<name>Quarkus - JAXP - Deployment</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-jaxp</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${project.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
58 changes: 58 additions & 0 deletions
58
extensions/jaxp/deployment/src/main/java/io/quarkus/jaxp/deployment/JaxpProcessor.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,58 @@ | ||
package io.quarkus.jaxp.deployment; | ||
|
||
import java.util.stream.Stream; | ||
|
||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; | ||
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem; | ||
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; | ||
|
||
class JaxpProcessor { | ||
|
||
@BuildStep | ||
void reflectiveClasses(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) { | ||
reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, | ||
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", | ||
"com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl", | ||
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl", | ||
"com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", | ||
"com.sun.org.apache.xerces.internal.parsers.SAXParser", | ||
"com.sun.org.apache.xml.internal.utils.FastStringBuffer")); | ||
|
||
reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, | ||
"com.sun.xml.internal.stream.XMLInputFactoryImpl", | ||
"com.sun.xml.internal.stream.XMLOutputFactoryImpl", | ||
"com.sun.org.apache.xpath.internal.functions.FuncNot", | ||
"com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl", | ||
"javax.xml.namespace.QName")); | ||
} | ||
|
||
@BuildStep | ||
void resourceBundles(BuildProducer<NativeImageResourceBundleBuildItem> resourceBundle) { | ||
Stream.of( | ||
"com.sun.org.apache.xml.internal.serializer.utils.SerializerMessages", | ||
"com.sun.org.apache.xml.internal.res.XMLErrorResources", | ||
"com.sun.org.apache.xerces.internal.impl.msg.SAXMessages", | ||
"com.sun.org.apache.xerces.internal.impl.msg.XMLMessages", | ||
"com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages", | ||
"com.sun.org.apache.xerces.internal.impl.xpath.regex.message") | ||
.map(NativeImageResourceBundleBuildItem::new) | ||
.forEach(resourceBundle::produce); | ||
} | ||
|
||
@BuildStep | ||
void resources(BuildProducer<NativeImageResourceBuildItem> resource) { | ||
|
||
Stream.of( | ||
"html", | ||
"text", | ||
"xml", | ||
"unknown") | ||
.map(s -> "com/sun/org/apache/xml/internal/serializer/output_" + s + ".properties") | ||
.map(NativeImageResourceBuildItem::new) | ||
.forEach(resource::produce); | ||
|
||
} | ||
|
||
} |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>quarkus-build-parent</artifactId> | ||
<groupId>io.quarkus</groupId> | ||
<version>999-SNAPSHOT</version> | ||
<relativePath>../../build-parent/pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-jaxp-parent</artifactId> | ||
<name>Quarkus - JAXP</name> | ||
<packaging>pom</packaging> | ||
<modules> | ||
<module>deployment</module> | ||
<module>runtime</module> | ||
</modules> | ||
|
||
</project> |
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,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>quarkus-jaxp-parent</artifactId> | ||
<groupId>io.quarkus</groupId> | ||
<version>999-SNAPSHOT</version> | ||
<relativePath>../</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-jaxp</artifactId> | ||
<name>Quarkus - JAXP - Runtime</name> | ||
<description>Java API for XML Processing</description> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-bootstrap-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${project.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
6 changes: 6 additions & 0 deletions
6
extensions/jaxp/runtime/src/main/resources/META-INF/quarkus-extension.yaml
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,6 @@ | ||
--- | ||
name: "JAXP" | ||
metadata: | ||
categories: | ||
- "xml" | ||
status: "stable" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
= Read me | ||
:config-file: microprofile-config.properties | ||
:toc: | ||
|
||
This module is testing the configuration and integration aspects of JPA; | ||
for example it covers reading configuration properties from the Quarkus config files as an alternative to the `persistence.xml`. | ||
|
||
All integration tests in this module use `H2`; other databases are being tested from other integration test modules. | ||
|
||
== How to run tests from the IDE | ||
|
||
They should just work: no preparation needed for this module. | ||
|
||
== Documentation | ||
|
||
See the `docs` section and the Hibernate guide. | ||
|
||
== Design questions | ||
|
||
* Is it appropriate to prioritize `persistence.xml` when it is present and ignore otherwise (i.e. disable automatic PU generation when `persistence.xml` is there | ||
** [SOLVED] we go for not allowing both | ||
* Is it appropriate to select `JTA` as the transaction type strategy | ||
* Is it appropriate to detect the dialect from the driver | ||
** [SOLVED] we start from that and can add runtime refinement of the dialect based on JDBC metadata and enlist all dialects of a family to avoid DCE | ||
* Which properties are the most useful for Hibernate ORM? | ||
** see section below | ||
* Do we have a pass through of properties under something like `quarkus.hibernate` | ||
** [SOLVED] we start with that | ||
* which prefix do we want? `quarkus.hibernate`, `hibernate`, `jpa` etc | ||
** what about `javax.persistence properties`? | ||
** [SOLVED] we start with `quarkus.hibernate` | ||
|
||
=== List of properties | ||
|
||
I am doing a first pass on the properties and I want to propose the following properties (and nothing else): | ||
|
||
* `hibernate.dialect` | ||
* `hibernate.show_sql` (and then `hibernate.format_sql` ?) | ||
* should show_sql not do System.out but rather a proper log | ||
* `javax.persistence.schema-generation.database.action` | ||
|
||
Anything else? | ||
|
||
I would force the following: | ||
|
||
* `javax.persistence.sharedCache.mode` to yes | ||
* `javax.persistence.sql-load-script-source` set to a default file name | ||
|
||
Questions do we need: | ||
|
||
* `javax.persistence.transactionType` | ||
|
||
|
Oops, something went wrong.