here is the what I have in maven dependencies: <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.3.5.Final</version> </dependency>
here is what I have in hibernate.cfg.xml: <?xml version="1.0" encoding="utf-8"?>
<hibernate-configuration xmlns="http://www.hibernate.org/xsd/hibernate-configuration" xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-configuration hibernate-configuration-4.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <session-factory> <!-- hibernate dialect --> <property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property> <!-- JDBC connection --> <property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property> <property name="hibernate.connection.url">jdbc:db2://somedb.test.company.net:1111/schema</property> <property name="hibernate.connection.username">id</property> <property name="hibernate.connection.password">pw</property> <!-- SQL rendering properties --> <property name="hibernate.format_sql">true</property> <property name="hibernate.use_sql_comments">true</property> <!-- List of XML mapping files, one file per module --> <mapping resource="class1.xml" /> </session-factory> </hibernate-configuration>
here is what I have in class1.xml: <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping" xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping hibernate-mapping-4.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <class name="JobOutput" table="JOB_OUTPUT"> <meta attribute="class-description"> This class contains a job output detail. </meta> <property name="jobId" column="JOB_REQUEST_ID" type="string"/> <property name="query" column="QUERY_VALUE" type="string"/> <property name="docId" column="DOCID" type="string"/> </class> </hibernate-mapping>
errors I am getting: Caused by: org.hibernate.MappingException: invalid configuration ... 1 more Caused by: org.xml.sax.SAXParseException: Element type "hibernate-configuration" is not declared. ...
my questions: 1) am I using the right header for hibernate 4.3 in hibernate.cfg.xml? http://www.hibernate.org/xsd/hibernate-configuration in browser is giving me error "Looks like you have found a broken link!" 2) if the header is close to be "right", where can I view this "hibernate-configuration-4.0.xsd" and "hibernate-mapping-4.0.xsd"?
|