[hibernate-issues] [JIRA] (HBX-2015) Allow custom reverse engineering strategy to enrich table/column metaattributes provided by hibernate.reveng.xml

Jordi Hernández (JIRA) jira at hibernate.atlassian.net
Sun Apr 12 17:22:40 EDT 2020


Jordi Hernández ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A8b2d9ba9-0164-469f-9b41-4c27ade9ba4e ) *created* an issue

Hibernate Tools ( https://hibernate.atlassian.net/browse/HBX?atlOrigin=eyJpIjoiZGY3MWNiODdiMzRhNDE0ZmE0ODJjYzA3N2JjM2IzOTAiLCJwIjoiaiJ9 ) / Improvement ( https://hibernate.atlassian.net/browse/HBX-2015?atlOrigin=eyJpIjoiZGY3MWNiODdiMzRhNDE0ZmE0ODJjYzA3N2JjM2IzOTAiLCJwIjoiaiJ9 ) HBX-2015 ( https://hibernate.atlassian.net/browse/HBX-2015?atlOrigin=eyJpIjoiZGY3MWNiODdiMzRhNDE0ZmE0ODJjYzA3N2JjM2IzOTAiLCJwIjoiaiJ9 ) Allow custom reverse engineering strategy to enrich table/column metaattributes provided by hibernate.reveng.xml ( https://hibernate.atlassian.net/browse/HBX-2015?atlOrigin=eyJpIjoiZGY3MWNiODdiMzRhNDE0ZmE0ODJjYzA3N2JjM2IzOTAiLCJwIjoiaiJ9 )

Issue Type: Improvement Affects Versions: 5.4.12.Final Assignee: Koen Aers ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A926ec7e6-0515-4337-a65b-32fd943f79ca ) Components: hbm2java, reverse-engineer Created: 12/Apr/2020 14:22 PM Priority: Minor Reporter: Jordi Hernández ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A8b2d9ba9-0164-469f-9b41-4c27ade9ba4e )

Currently, when a hibernate.reveng.xml is provided alongside an implementation of ReverseEngineeringStrategy there are some cases in which the latter is completely ignored, making it pointless to implement some of its methods.
An instance of the OverrideRepository is created, which creates an internal implementation of a ReverseEngineeringStrategy (which, I notice, has recently been renamed to RevengStrategy). Now, this implementation will pick when to call or not the user provided implementation.
In the case of the methods that generate MetaAttributes for tables and columns, the RevengStrategy implementation is bypassed altogether. This means that you cannot enrich this metadata for template specifics at the same time as you provide some configuration via hibernate.reveng.xml.
I believe that metadata from the XML file and the reveng strategy implementation do not need to be exclusive, since after all metadata is put in a Map and therefore many different bits of information can be provided from each side.
So the solution to this, which I implemented in a PR, is to call the reverse engineering implementation, grab whatever metadata is generated there, and merge it with the one coming from the xml mapping file.

( https://hibernate.atlassian.net/browse/HBX-2015#add-comment?atlOrigin=eyJpIjoiZGY3MWNiODdiMzRhNDE0ZmE0ODJjYzA3N2JjM2IzOTAiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HBX-2015#add-comment?atlOrigin=eyJpIjoiZGY3MWNiODdiMzRhNDE0ZmE0ODJjYzA3N2JjM2IzOTAiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100124- sha1:185bad4 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200412/4964319e/attachment.html 


More information about the hibernate-issues mailing list