Parse WebSphere object/relational mapping files as XML - #8428
Merged
Conversation
Add mapxmi, tblxmi, dbxmi, and schxmi to the XML parser's accepted file extensions. These hold the CMP entity bean to table/column mapping written by WebSphere and Rational Application Developer, and are not derivable from the deployment descriptor. Claude-Session: https://claude.ai/code/session_0183p9nXiN3wGtiCpNPtyCnJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds four extensions to
XmlParser.ACCEPTED_FILE_EXTENSIONS:mapxmiMap.mapxmi— the entity/field to table/column mappingtblxmiRDBSchema:RDBTabledbxmischxmiThese are the object/relational mapping files WebSphere and Rational Application Developer write for container-managed persistence entity beans. They are all XML (XMI 2.0, same family as the already-accepted
xmi), they just don't use the.xmiextension.Why
The current failure is silent, which is the problem.
An estate migrating off container-managed persistence needs these files, because the table and column names live nowhere else — they are not derivable from the deployment descriptor. A real application maps an
addressIdfield to anADDR_IDcolumn, and a bean namedBonusto a table namedXBONUS. You cannot recover that fromejb-jar.xml.Today those files aren't parsed, so a recipe that reads them resolves nothing — and "this estate has no mapping files" and "we could not read your mapping files" produce an identical result. There is no error, no warning, and nothing in the LST to inspect. The usual workaround is to add
plainTextMasksto every build and re-parse the plain text throughXmlParserby hand, which every consumer has to rediscover independently.Evidence
Verified against real published artifacts, not synthesized:
eclipse-jeetools/webtools.javaee— RAD/Cloudscape test data;mapxmi,tblxmi,schxmihealthcit/BIGR— older RAD/Oracle, flatMETA-INF/Schema/layout;Map.mapxmiplus ~170.tblxmiJCPuerto/wcs76fp5— WebSphere Commerce, DB2 LUW;Map.mapxmialongside the newer.dbmform discussed belowA representative
.tblxmifromhealthcit/BIGR:On
.dbm— deliberately excludedThe newer Eclipse Data Tools form of the same mapping is
.dbm(rootxmi:XMIwithLUW:LUWTable/LUW:LUWColumn), and it was a candidate for this PR. I left it out: unlike the other four,.dbmis not specific enough to assume XML. Sampling real.dbmfiles in the wild turns up plenty that are not:interchange/interchange— Interchangedbconfdescriptors, e.g. a single lineDatabase news news.txt TABtemcdrm/emthub— ATP/EMTP data modules, a fixed-column plain text formatjsonn/pkgsrc—PLIST.dbm, a pkgsrc packing list.dbmis also the historical extension for binary DBM/GDBM key-value stores and for DAZ Studio shader files. Accepting it would meanXmlParserclaiming files it cannot parse, trading one silent failure for a noisier one. The other four extensions have no such ambiguity — they are WebSphere/RAD-specific and always XMI.If there's appetite for
.dbmit's better as a separate discussion, possibly gated on content sniffing rather than extension alone.Testing
websphereTableMapping— round-trips a real-shaped.tblxmidocumentacceptWithValidPathsparameterized test./gradlew :rewrite-xml:testpasses.https://claude.ai/code/session_0183p9nXiN3wGtiCpNPtyCnJ