-
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.
Push Hibernate ORM DevConsole info on startup instead of pulling it a…
…t runtime
- Loading branch information
Showing
9 changed files
with
87 additions
and
120 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
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
85 changes: 52 additions & 33 deletions
85
...vconsole/PersistenceUnitInfoSupplier.java → ...e/HibernateOrmDevConsoleInfoSupplier.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
23 changes: 23 additions & 0 deletions
23
...in/java/io/quarkus/hibernate/orm/runtime/devconsole/HibernateOrmDevConsoleIntegrator.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,23 @@ | ||
package io.quarkus.hibernate.orm.runtime.devconsole; | ||
|
||
import org.hibernate.boot.Metadata; | ||
import org.hibernate.engine.spi.SessionFactoryImplementor; | ||
import org.hibernate.integrator.spi.Integrator; | ||
import org.hibernate.jpa.AvailableSettings; | ||
import org.hibernate.service.spi.SessionFactoryServiceRegistry; | ||
|
||
public class HibernateOrmDevConsoleIntegrator implements Integrator { | ||
@Override | ||
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactoryImplementor, | ||
SessionFactoryServiceRegistry sessionFactoryServiceRegistry) { | ||
HibernateOrmDevConsoleInfoSupplier.pushPersistenceUnit( | ||
(String) sessionFactoryImplementor.getProperties().get(AvailableSettings.PERSISTENCE_UNIT_NAME), | ||
metadata, sessionFactoryServiceRegistry); | ||
} | ||
|
||
@Override | ||
public void disintegrate(SessionFactoryImplementor sessionFactoryImplementor, | ||
SessionFactoryServiceRegistry sessionFactoryServiceRegistry) { | ||
// Nothing to do | ||
} | ||
} |