-
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.
Refactor the HibernateOrmProcessor to decompose the build steps into …
…smaller items This is necessary to avoid cycles in upcoming fixes
- Loading branch information
Showing
6 changed files
with
192 additions
and
48 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
24 changes: 24 additions & 0 deletions
24
.../deployment/src/main/java/io/quarkus/hibernate/orm/deployment/JpaModelIndexBuildItem.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,24 @@ | ||
package io.quarkus.hibernate.orm.deployment; | ||
|
||
import org.jboss.jandex.CompositeIndex; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
/** | ||
* Provides the Jandex index of the application, combined with the index | ||
* of additional JPA components that might have been generated. | ||
* | ||
* @author Sanne Grinovero <[email protected]> | ||
*/ | ||
public final class JpaModelIndexBuildItem extends SimpleBuildItem { | ||
|
||
private final CompositeIndex index; | ||
|
||
public JpaModelIndexBuildItem(CompositeIndex index) { | ||
this.index = index; | ||
} | ||
|
||
public CompositeIndex getIndex() { | ||
return index; | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
.../src/main/java/io/quarkus/hibernate/orm/deployment/PersistenceXmlDescriptorBuildItem.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,26 @@ | ||
package io.quarkus.hibernate.orm.deployment; | ||
|
||
import org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
/** | ||
* Provides instances of {@see ParsedPersistenceXmlDescriptor}, the raw representation | ||
* of a persistence.xml file as it is after being located and parsed. | ||
* Exposed as a possible integration API: other extensions can produce additional | ||
* configuration instances. | ||
* | ||
* @author Sanne Grinovero <[email protected]> | ||
*/ | ||
public final class PersistenceXmlDescriptorBuildItem extends MultiBuildItem { | ||
|
||
private final ParsedPersistenceXmlDescriptor descriptor; | ||
|
||
public PersistenceXmlDescriptorBuildItem(ParsedPersistenceXmlDescriptor descriptor) { | ||
this.descriptor = descriptor; | ||
} | ||
|
||
protected ParsedPersistenceXmlDescriptor getDescriptor() { | ||
return descriptor; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ployment/src/main/java/io/quarkus/hibernate/orm/deployment/ProxyDefinitionsBuildItem.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,28 @@ | ||
package io.quarkus.hibernate.orm.deployment; | ||
|
||
import java.util.Objects; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
import io.quarkus.hibernate.orm.runtime.proxies.PreGeneratedProxies; | ||
|
||
/** | ||
* Contains the reference to the class definitions of the proxies | ||
* that Hibernate ORM might require at runtime. | ||
* In Quarkus such proxies are built upfront, during the build. | ||
* This needs to be a separate build item from other components so | ||
* to avoid cycles in the rather complex build graph required by | ||
* this extension. | ||
*/ | ||
public final class ProxyDefinitionsBuildItem extends SimpleBuildItem { | ||
|
||
private final PreGeneratedProxies proxies; | ||
|
||
public ProxyDefinitionsBuildItem(PreGeneratedProxies proxies) { | ||
Objects.requireNonNull(proxies); | ||
this.proxies = proxies; | ||
} | ||
|
||
public PreGeneratedProxies getProxies() { | ||
return proxies; | ||
} | ||
} |