Where to find the DTD of Hibernate?

13,200

Solution 1

Hibernate 5 and newer

DTD:

hibernate-core-5.2.10.Final.jar\org\hibernate\hibernate-configuration-3.0.dtd
hibernate-core-5.2.10.Final.jar\org\hibernate\hibernate-mapping-3.0.dtd

XSD:

hibernate-core-5.2.10.Final.jar\org\hibernate\hibernate-configuration-3.0.xsd
hibernate-core-5.2.10.Final.jar\org\hibernate\hibernate-mapping-3.0.xsd    

Hibernate 4

hibernate-core-4.3.5.Final.jar\org\hibernate\hibernate-configuration-3.0.dtd 
hibernate-core-4.3.5.Final.jar\org\hibernate\hibernate-mapping-3.0.dtd 

and Hibernate 4 was upgraded to use XSDs as well:

hibernate-core-4.3.5.Final.jar\org\hibernate\hibernate-configuration-4.0.xsd
hibernate-core-4.3.5.Final.jar\org\hibernate\hibernate-mapping-4.0.xsd

Hibernate 3

For old versions, like hibernate3.jar you can find them under:

hibernate3.jar\org\hibernate\hibernate-configuration-3.0.dtd
hibernate3.jar\org\hibernate\hibernate-mapping-3.0.dtd

For any version 3.x or above not listed here, you can find these files in your hibernate-core-X.x.Final.jar archive under the org.hibernate package

Solution 2

Here is an image by which you will get a clear image in your mind that’s where will you get DTD. Click me to open Image for hibernate DTD

Open jar file respectively.

hibernate-core-5.4.10.Final.jar
org.hibernate
hibernate-configuration-3.0.dtd
hibernate-mapping-3.0.dtd

When you will open org.hibernate

You will get two dtd

one for

Hibernate configuration
Hibernate mapping

Hibernate configuration

<!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

Hibernate Mapping

<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
Share:
13,200
NewUser
Author by

NewUser

A Minion exploring set on a mission to learn all the evilness from Java :) Learn bad ways to (avoid)screwing around.

Updated on June 16, 2022

Comments

  • NewUser
    NewUser almost 2 years

    The DTD in the hibernate jar is a good way to know what are the attributes that can be included and the expected name for that tag.

    Opening up the DTD file is the easiest way to get an overview of all elements and attributes, and to view the defaults, as well as some comments.

    This will help the programmer to write hibernate.cfg.xml file from scracth(crazy but some people do ask this to achieve without using internet :O )

    Please tell where to locate the DTD when we have a hibernate jar.

    This is not a programming question but will be helpful for programmer.

  • NewUser
    NewUser almost 10 years
    The packaging structure for hibernate-core jar and hibernate3.jar is different. Can you please add that too. I will mark your answer as accepted.