Skip to content

Conversation

@koentsje
Copy link
Member

@koentsje koentsje commented Oct 15, 2025

[Please describe here what your change is about]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19879

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Oct 15, 2025

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@koentsje koentsje force-pushed the merge-tools-into-orm branch 2 times, most recently from 9d4e4ec to 094c21a Compare October 20, 2025 14:10
Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few comments below to track things we discussed and that we shouldn't forget.

Also created a Jira issue: https://hibernate.atlassian.net/browse/HHH-19879

import org.hibernate.tool.gradle.task.GenerateJavaTask;
import org.hibernate.tool.gradle.task.RunSqlTask;

public class Plugin implements org.gradle.api.Plugin<Project> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be the same plugin as enhancement, so that we can use a syntax like this one:

hibernate {
    enhancement { ... }
    reveng { ... }
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honest question: would this make sense to use in an application/framework as a library, and if so do we want to keep this module under tooling/?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: migrate (all?) other tests from Tools. We can target h2 only for a start.

Main challenge would be conveting hbm.xml to orm.xml (mapping.xml?) or annotations.

Comment on lines 38 to 42
@Mojo(
name = "hbm2orm",
defaultPhase = GENERATE_RESOURCES,
requiresDependencyResolution = ResolutionScope.RUNTIME)
public class TransformHbmMojo extends AbstractMojo {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great and I know people have been asking for it.

We need it documented, though :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is something wrong here. Seem you duplicated the package? The SchemaExport class already exists in this module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, the classes you duplicated here should instead be moved from hibernate-ant to this module.

@koentsje koentsje force-pushed the merge-tools-into-orm branch 25 times, most recently from 8239046 to 30152da Compare October 24, 2025 09:00
@koentsje koentsje force-pushed the merge-tools-into-orm branch 9 times, most recently from 0678f91 to d3636e2 Compare October 27, 2025 13:21
import org.hibernate.tool.reveng.internal.export.java.Cfg2JavaTool;
import org.jboss.logging.Logger;

import java.io.File;

Check notice

Code scanning / CodeQL

Constant interface anti-pattern Note

Type AbstractExporter implements constant interface
ExporterConstants
.

protected MetadataDescriptor getMetadataDescriptor() {
return (MetadataDescriptor)getProperties().get(METADATA_DESCRIPTOR);
}

Check notice

Code scanning / CodeQL

Exposing internal representation Note

getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
getProperties exposes the internal representation stored in field properties. The value may be modified
after this call to getProperties
.
iterator = getProperties().entrySet().iterator();
while ( iterator.hasNext() ) {
Entry<Object, Object> element = iterator.next();
Object value = transformValue(element.getValue());

Check notice

Code scanning / CodeQL

Unread local variable Note

Variable 'Object value' is never read.
@koentsje koentsje force-pushed the merge-tools-into-orm branch 5 times, most recently from d906480 to c35239f Compare October 28, 2025 17:23
@koentsje koentsje force-pushed the merge-tools-into-orm branch 4 times, most recently from feec75d to 554e870 Compare October 29, 2025 11:10
…erge the relevant ant/gradle/maven plugins

  - Add the Reverse Engineering module
@koentsje koentsje force-pushed the merge-tools-into-orm branch from 554e870 to 606af22 Compare October 29, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants