Hi,
i am getting exception
org.hibernate.MappingException: Could not parse mapping document in input stream Caused by: org.dom4j.DocumentException: org.apache.xerces.impl.dv.xs.ListDV$ListData Nested exception: org.apache.xerces.impl.dv.xs.ListDV$ListData
actually i am using the sessionFactory ( AnnotationSessionFactoryBean ) and setting the mappingResources like
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /></property>
<property name="mappingResources">
<list> <value>namedQueries.hbm.xml</value> </list> </property> <property name="annotatedClasses"> <list> <value>com.entity.impl.XXXEntity</value> <value>com.entity.impl.XXXEntity</value> </list> </property> </bean>
i want to utilize the NamedQueries, i don't want put @NamedQuery in entity class so that DBA can view the SQL query,
i ve trid following 2 file formats but still i am facing same exception
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<query name="getClientById"><![CDATA[ select c.id, c.firstName from com.mobex.mca.entity.impl.ClientEntity c where c.id = ? ]]></query>
</hibernate-mapping>
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping>
<class name="com.mobex.mca.entity.impl.BankEntity" table="BANK"> <id name="id" type="long" column="ID" unsaved-value="0"> <generator class="increment"/> </id> <property name="bankName" column="BANK_NAME"/> </class>
<query name="getClientById"><![CDATA[ select c.id, c.firstName from com.mobex.mca.entity.impl.ClientEntity c where c.id = ? ]]></query>
</hibernate-mapping>
Kindly reply
thanks
_________________ Kashif Bashir
Mobex Limited kashefbasher@gmail.com
|