Quarkus: Hibernate ORM extension for Hibernate Types extensions

Created on 8 Jun 2020  路  9Comments  路  Source: quarkusio/quarkus

Describe the extension
We should have an additional extension to enable the Hibernate Types from Vlad's project at

(as discussed on the mailing list).

I think we could eventually have the Hibernate ORM extension depend on it automatically (so to pull the dependency in transparently), but I'd prefer to reserve such a move for a future decision; especially as long as this is experimental is should be an explicit opt-in.

@andrejpetras also wondered if:

Would it be possible to avoid the @TypeDef annotation and generate it directly with the Quarkus extension?

I think that would be possible, but haven't explored it in detail. I sugest let's create the extension first, then we can explore such improvements as a follow up.

arehibernate-orm arepersistence kinextension-proposal releasnoteworthy-feature

Most helpful comment

@Sanne @famod @akoufa
Hi guys, could you please check this branch:
https://github.com/andrejpetras/quarkus/tree/9861_hibernate_types/extensions/hibernate-types

I implemented the first version of this extension (not final), we could use it for a discussion:

  • standard deployment and runtime modules
  • one of these modules needs to be in the class-path

    • jackson module is JSON impl module for Hibernate Types

    • jsonb module is JSON implserializer module for Hibernate Types

I also added an integration test for Hibernate types extension + jackson + postgresql
https://github.com/andrejpetras/quarkus/tree/9861_hibernate_types/integration-tests/hibernate-types-jackson-postgresql

I would like to have feedback from quarkus before I will continue with this approach.

All 9 comments

/cc @gsmet @Sanne

Hi,

I migrated Vlad's Hibernation types as a Quarkus extension.

Source code: https://github.com/lorislab/quarkus-hibernate-types

Changes:

  • remove dependencies to old Hibernate versions and add Quarkus dependency
  • replace object copy with a Jackson "object copy"
  • remove all reflection
  • Inject Jackson ObjectMapper from Quarkus Arc CDI container

CamelCaseToSnakeCaseNamingStrategy from Vlad's project is also helpful!

@andrejpetras Your extension does not contain this strategy, right?

CamelCaseToSnakeCaseNamingStrategy from Vlad's project is also helpful!

@andrejpetras Your extension does not contain this strategy, right?

@famod I didn't know about this. But it looks like it's a class that could be migrated to the Quarkus.

@Sanne @famod
I started working on it. My branch: https://github.com/andrejpetras/quarkus/tree/9861_hibernate_types/extensions/hibernate-types

I will write the implementation and the tests first, and then we can move it to the right place.
I switch the implementation from Jackson to Jsonb (but I am no sure about this change)

Comments are welcome

I wonder why things like CamelCaseToSnakeCaseNamingStrategy aren't contributed into Hibernate ORM. It's not that useful to have to include an additional extension just for that?

@andrejpetras What is the status of this issue ? Are you continuing working on it ?

@akoufa did not have time last month but I hope this weekend I can spend few hours on it.

@Sanne @famod @akoufa
Hi guys, could you please check this branch:
https://github.com/andrejpetras/quarkus/tree/9861_hibernate_types/extensions/hibernate-types

I implemented the first version of this extension (not final), we could use it for a discussion:

  • standard deployment and runtime modules
  • one of these modules needs to be in the class-path

    • jackson module is JSON impl module for Hibernate Types

    • jsonb module is JSON implserializer module for Hibernate Types

I also added an integration test for Hibernate types extension + jackson + postgresql
https://github.com/andrejpetras/quarkus/tree/9861_hibernate_types/integration-tests/hibernate-types-jackson-postgresql

I would like to have feedback from quarkus before I will continue with this approach.

Was this page helpful?
0 / 5 - 0 ratings