Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 229776 Details for
Bug 397316
orm.xml schema validation does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed changes (2.4.2)
patch397316.patch (text/plain), 3.74 KB, created by
Guy Pelletier
on 2013-04-16 14:42:05 EDT
(
hide
)
Description:
Proposed changes (2.4.2)
Filename:
MIME Type:
Creator:
Guy Pelletier
Created:
2013-04-16 14:42:05 EDT
Size:
3.74 KB
patch
obsolete
>From 9fa72a6c48b2e3925bbc66011b58227e348c4fb0 Mon Sep 17 00:00:00 2001 >From: gpelletie <guy.pelletier@oracle.com> >Date: Tue, 16 Apr 2013 14:40:30 -0400 >Subject: [PATCH] Bug 397316 - orm.xml schema validation does not work > >Reviewed: Tom Ware > >Approved: Peter Krogh >--- > .../advanced-tpt-multitenant-entity-mappings.xml | 2 +- > .../jpa/metadata/xml/XMLEntityMappingsReader.java | 23 ++++++++++++++++++++++ > 2 files changed, 24 insertions(+), 1 deletion(-) > >diff --git a/jpa/eclipselink.jpa.test/resource/eclipselinkorm/eclipselink-xml-extended-model/advanced-tpt-multitenant-entity-mappings.xml b/jpa/eclipselink.jpa.test/resource/eclipselinkorm/eclipselink-xml-extended-model/advanced-tpt-multitenant-entity-mappings.xml >index 00c1047..0ea82a1 100644 >--- a/jpa/eclipselink.jpa.test/resource/eclipselinkorm/eclipselink-xml-extended-model/advanced-tpt-multitenant-entity-mappings.xml >+++ b/jpa/eclipselink.jpa.test/resource/eclipselinkorm/eclipselink-xml-extended-model/advanced-tpt-multitenant-entity-mappings.xml >@@ -96,8 +96,8 @@ > </join-table> > </many-to-many> > <element-collection name="honors"> >- <collection-table name="XML_CANDIDATE_HONORS"/> > <column name="HONOR"/> >+ <collection-table name="XML_CANDIDATE_HONORS"/> > </element-collection> > </attributes> > </entity> >diff --git a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/xml/XMLEntityMappingsReader.java b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/xml/XMLEntityMappingsReader.java >index f31c376..d820169 100644 >--- a/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/xml/XMLEntityMappingsReader.java >+++ b/jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/xml/XMLEntityMappingsReader.java >@@ -36,14 +36,17 @@ import javax.xml.validation.Schema; > import javax.xml.validation.SchemaFactory; > > import org.eclipse.persistence.config.PersistenceUnitProperties; >+import org.eclipse.persistence.exceptions.EclipseLinkException; > import org.eclipse.persistence.exceptions.ValidationException; > import org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider; > > import org.eclipse.persistence.oxm.XMLConstants; > import org.eclipse.persistence.oxm.XMLContext; > import org.eclipse.persistence.oxm.XMLUnmarshaller; >+import org.xml.sax.ErrorHandler; > import org.xml.sax.InputSource; > import org.xml.sax.SAXException; >+import org.xml.sax.SAXParseException; > import org.xml.sax.XMLReader; > > /** >@@ -214,6 +217,26 @@ public class XMLEntityMappingsReader { > */ > private static void useLocalSchemaForUnmarshaller(XMLUnmarshaller unmarshaller, Schema schema) { > try { >+ >+ unmarshaller.setErrorHandler(new ErrorHandler() { >+ @Override >+ public void error(SAXParseException exception) throws SAXException { >+ throw exception; >+ } >+ >+ @Override >+ public void fatalError(SAXParseException exception) throws SAXException { >+ throw exception; >+ } >+ >+ @Override >+ public void warning(SAXParseException exception) throws SAXException { >+ if (exception.getException() instanceof EclipseLinkException) { >+ throw (EclipseLinkException) exception.getCause(); >+ } >+ } >+ }); >+ > unmarshaller.setSchema(schema); > } catch (UnsupportedOperationException ex) { > // Some parsers do not support setSchema. In that case, setup validation another way. >-- >1.7.11.msysgit.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 397316
:
229764
| 229776