I'm surprised that Hibernate doesn't already do that. But if it doesn't, here's what you need to do:
(1) Write an EntityResolver which returns an InputSource containing your local copy of the DTD when it's called. The documentation for EntityResolver has an example of how to do that.
(2) Persuade Hibernate's XML parser, the one which reads the XML configuration files, to use your EntityResolver. I just googled "hibernate entityresolver" and found e.g. this reference document which appears to tell you how to do that.
posted 5 years ago
Iam using Hibernate with Spring. Any clues to add the custom Entityrolver via Spring configuration xml. If suppose iam using a Standalone java code i can register using