quarkusio / quarkus-quickstarts

Quarkus quickstart code
https://quarkus.io
Apache License 2.0
1.94k stars 1.44k forks source link

how to manually configure Hibernate hibernate-orm-quickstart #887

Open liuzqt opened 3 years ago

liuzqt commented 3 years ago

I used to use hibernate with its own APIs like Configuration, ServiceRegistry, and I would like to add some customized things in Configuration such as adding customized triggers, indexes using DDLs. Specifically, something like this:

Configuration configuration = new CustomConfiguration().configure()
        .addAnnotatedClass(XXXXX.class)
        ...;

configuration.addAuxiliaryDatabaseObject(...); // add some customzied triggers and index here

Not pretty familiar with JPA-style APIs, I know they are somehow equivalent or similar to Hibernate's own APIs.

So what I want to do is, still, have the ability to add some customized things to Hibernate in Configuration, there're probably a few approaches seems make sense to me:

  1. try to get Hibernate's native APIs from JPA APIs
  2. does JPAs APIs provide equivalent functions as Hibernate's APIs?

What might be a recommended practice in quarkus? And how to do is still not very clear to me since I can not find a main entrance in the example

liuzqt commented 3 years ago

it seems that AuxiliaryDatabaseObject is a hibernate specific thing, so I guess I might have to use hibernate native style bootstraping?