Hibernate extension, add support for `autoGenMap=false`

Description

Currently, Lucee does not support turning-off generating `hbxml` files;

See: https://github.com/lucee/extension-hibernate/blob/3.5.5/source/java/src/org/lucee/extension/orm/hibernate/HibernateORMEngine.java#L135

For a large application, this can reduce the application startup time considerably; And for a containerized environment it can be easily used at the warm-up time (see https://luceeserver.atlassian.net/browse/LDEV-1196 ) to generate the mapping, so the good can get even better.

  • There's an issue reported on the GitHub-repo as well.

  • Also, ACF does support this, and it's a matter of compatibility as well.

If provided with the necessary setup/steps and challenges I'm willing to make a PR for this.

Attachments

2
  • 16 Jun 2023, 07:08 am
  • 16 Jun 2023, 07:08 am

Activity

Show:

Zac Spitzer 16 June 2023 at 09:20
Edited

https://github.com/lucee/extension-hibernate/pull/41

it now throws an error, the understanding of Lucee resource checking was wrong.

Lucee always returns a resource, you need to then check if it exists()

test case with a missing xml mapping file and autoGenMap=false now throws

Hibernate mapping not found for entity: [test], missing xml file [/home/runner/work/extension-hibernate/extension-hibernate/tests/autogenmapMissing/test.cfc.hbm.xml]

not fixed as per expected behaviour from ACF, but the error is working now as intended

Theory being, if you turn this off, you are saying I want high performance and I’m providing my mapping xml files, without throwing here, you may be missing some files and if we auto magically create them anyway, you won’t be getting that expected performance boost

Pothys - MitrahSoft 16 June 2023 at 07:08

I've checked this issue with lucee latest version 6.0.0.461-SNAPSHOT and Hibernate extension version 5.4.29.22-BETA. Now lucee ormsetting support "autoGenMap=false".
But when set the "autoGenMap=false" in ormsetting, it throws NoSuchFileException (C:\portables\lucee-express-6.0.0.453-SNAPSHOT\webapps\ROOT\autogenmap\test.cfc.hbm.xml) error in Lucee. Seems ACF doesn't throws any error.

Fixed

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Priority

Created 19 May 2021 at 16:00
Updated 1 July 2023 at 16:22
Resolved 1 July 2023 at 16:22