From 469669f121671a9f733d426fbbeddd4016f769ef Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Wed, 31 May 2006 17:00:12 +0000 Subject: [PATCH] documented DTDEntityResolver capabilities git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@9973 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- reference/en/modules/basic_mapping.xml | 54 +++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/reference/en/modules/basic_mapping.xml b/reference/en/modules/basic_mapping.xml index f46277303a..1aa813c6a1 100644 --- a/reference/en/modules/basic_mapping.xml +++ b/reference/en/modules/basic_mapping.xml @@ -96,7 +96,7 @@ - + Doctype @@ -107,6 +107,58 @@ Internet connection, check your DTD declaration against the contents of your claspath. + + + EntityResolver + + As mentioned previously, Hibernate will first attempt to resolve DTDs in its classpath. The + manner in which it does this is by registering a custom org.xml.sax.EntityResolver + implementation with the SAXReader it uses to read in the xml files. This custom + EntityResolver recognizes two different systemId namespaces. + + + + + a hibernate namespace is recognized whenever the + resolver encounteres a systemId starting with + http://hibernate.sourceforge.net/; the resolver + attempts to resolve these entities via the classlaoder which loaded + the Hibernate classes. + + + + + a user namespace is recognized whenever the + resolver encounteres a systemId using a classpath:// + URL protocol; the resolver will attempt to resolve these entities + via (1) the current thread context classloader and (2) the + classloader which loaded the Hibernate classes. + + + + + An example of utilizing user namespacing: + + + +]> + + + + + ... + + + &types; +]]> + + Where types.xml is a resource in the your.domain + package and contains a custom typedef. + +