Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8229739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:54:05+00:00 2026-06-07T16:54:05+00:00

This page suggests !ENTITY: If you want to avoid duplication, consider using XML entities

  • 0

This page suggests !ENTITY:

If you want to avoid duplication, consider using XML entities (for
example, [ ] in the
DOCTYPE declaration and %allproperties; in the mapping).

The problem is that I can’t find anywhere on the web a complete working example.

What I got so far is:

<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
        [ <!ENTITY allproperties SYSTEM "allproperties.xml"> ]
        >

.. but what about the rest?
1. How EXACTLY do I define the properties in the allproperties.xml file?
2. How/Where EXACTLY do I include the %allproperties; keyword (within my <class> and <union-class>)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:54:07+00:00Added an answer on June 7, 2026 at 4:54 pm

    This is a basic XML construct called an entity include. You file named ‘allproperties.xml’ would contain the property mapping fragments of the entities. For example:

    <property name="name".../>
    <property name="someOtherProperty".../>
    <!-- rest of shared property definitions -->
    

    Then in a mapping file you’d say:

    <!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" [ 
        <!ENTITY allproperties SYSTEM "allproperties.xml"> ]>
    
    <hibernate-mapping>
        <class name="Class1" ...>
            <id .../>
            &allproperties;
        </class>
        <class name="Class2" ...>
            <id .../>
            &allproperties;
        </class>
    </hibernate-mapping>
    

    I defined the <id/> mapping in each class here, but you can move that into the include file as well if the information is all the same. Anything that is valid as a child of <class/> will work in the include file.

    JAXP expects SYSTEM references to be relative or absolute file references. So above means that the allproperties.xml file would be resolved relative to system identifier of the include file. Often that might not work out so well. To that end, Hibernate also understands a special type of SYSTEM reference prefixed with classpath://. As you might expect that triggers a classpath resource lookup for the referenced resource.

    <!DOCTYPE hibernate-mapping PUBLIC
            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
            "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" [ 
        <!ENTITY allproperties SYSTEM "classpath://com/acme/allproperties.xml"> ]>
    

    Now, allproperties.xml will be resolved via a classpath lookup using the com/acme/allproperties.xml resource name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Premise: This Wikipedia page suggests that the computational complexity of Schoolbook long division is
Consider this page @ http://www.bloodbone.ws/screwed.html I need to be able to have the a.grow
I'm reading about using git as an svn client here: http://learn.github.com/p/git-svn.html That page suggests
Do C and C++ compilers generally optimize comparisons with functions? For example, this page
Specifically I'm looking at Symphony and I'm running through this page. It suggests that
I am using the LDAP connection class, working from this page on MSDN .
I read this article, it suggests (page 1025 last paragraph) that there is a
HTML5Boiler plate suggests we put this one in our HTML page if we favour
I found this page that suggests looping until exceptions is thrown and then handle
I want menu in my page to look like this: About us | Contacts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.