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.
Hibernate ORM and Hibernate Reactive cannot be used in the same appli…
…cation quarkusio#13425 quarkusio#13425
- Loading branch information
1 parent
8ff5400
commit 926d8de
Showing
19 changed files
with
623 additions
and
59 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
25 changes: 25 additions & 0 deletions
25
...hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/ReactivePersistenceUnit.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,25 @@ | ||
package io.quarkus.hibernate.orm; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PACKAGE; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import jakarta.inject.Qualifier; | ||
import jakarta.persistence.EntityManagerFactory; | ||
|
||
/** | ||
* This is used to qualify the {@link EntityManagerFactory} that should be used for Hibernate Reactive. | ||
*/ | ||
@Target({ TYPE, FIELD, METHOD, PARAMETER, PACKAGE }) | ||
@Retention(RUNTIME) | ||
@Documented | ||
@Qualifier | ||
public @interface ReactivePersistenceUnit { | ||
} |
32 changes: 32 additions & 0 deletions
32
...e/src/main/java/io/quarkus/hibernate/orm/runtime/MultiplePersistenceProviderResolver.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,32 @@ | ||
package io.quarkus.hibernate.orm.runtime; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import jakarta.persistence.spi.PersistenceProvider; | ||
import jakarta.persistence.spi.PersistenceProviderResolver; | ||
|
||
public final class MultiplePersistenceProviderResolver implements PersistenceProviderResolver { | ||
|
||
private final List<PersistenceProvider> persistenceProviders = new ArrayList<>(); | ||
|
||
public MultiplePersistenceProviderResolver(PersistenceProvider... persistenceProviders) { | ||
this.persistenceProviders.addAll(List.of(persistenceProviders)); | ||
} | ||
|
||
@Override | ||
public List<PersistenceProvider> getPersistenceProviders() { | ||
return Collections.unmodifiableList(persistenceProviders); | ||
} | ||
|
||
public void addPersistenceProvider(PersistenceProvider persistenceProvider) { | ||
persistenceProviders.add(persistenceProvider); | ||
} | ||
|
||
@Override | ||
public void clearCachedProviders() { | ||
// done! | ||
} | ||
|
||
} |
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
Oops, something went wrong.