On Wed, 15 Dec 2004 20:49:51 -0800, Safdar Kureishy <[EMAIL PROTECTED]> wrote:

It is not that way in Hibernate3 anymore.

I guess we could "backport" that to hibernate 2.1.8 if requested ;)

Add a JIRA for 2.1.8 on changing mapping+ to mapping* in the DTD.
and see what happens ;)

/max

Hi,


I couldn't find any discussion on this topic so am posting this to the newsgroup ...


I am running into a situation where I want to initialize a Hibernate Configuration object from a hibernate cfg file, but without any mappings (i.e without any <mapping> elements). Instead, I want to add the mappings programmatically. However, during initialization of the Configuration object, I get a parser error since the DTD for the hibernate config file requires at least one <mapping> element be specified under the <session-factory> element.


So, a configuration like this:


<hibernate-configuration>

            <session-factory>

                        <property name="XYZ">lkjsdlfkjsd</property>

                        ...

                        <mapping resource="com/mycompany/X.hbm.xml"/> ##
THIS PORTION IS REQUIRED ###

            </session-factory>

</hibernate-configuration>


... will give an error if the <mapping> element is removed, based on the DTD.


My question is, why is this required? It defeats the purpose of being able to specify different portions of the configuration separately ...


Also, is there any way to not have to specify this <mapping> element? I tried giving an empty <mapping> element and one with <mapping resource=""/> but both throw errors as well.


Any ideas will be greatly appreciated.


Thanks,

Safdar




-- Max Rydahl Andersen callto://max.rydahl.andersen

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]
http://jboss.com


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to