Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Hibernate org.hibernate.InvalidMappingException: Could not parse mapping document
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sundar
org.hibernate.InvalidMappingException: Could not parse mapping document
2 Answer(s)      6 years and 8 months ago
Posted in : Hibernate



Advertisement
View Answers

April 29, 2008 at 7:34 PM


Hi


package roseindia;

public class Procedure {
private String username;
private String room;
private String address;
private String faname;
private int id;

public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getRoom() {
return room;
}
public void setRoom(String room) {
this.room = room;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}

public String getFaname(){
return faname;
}
public void setFaname(String faname){
this.faname = faname;
}

}

---------------------------------

package roseindia;

import org.hibernate.*;
import org.hibernate.criterion.*;
import org.hibernate.cfg.*;

import java.util.*;

public class StoreprocedureExam {
public static void main(String arg[]){
Session session = null;
try {
SessionFactory sessionFactory = new Configuration().configure()
.buildSessionFactory();
session = sessionFactory.openSession();
String SQL_QUERY ="from Procedure proced";
Query query = session.createQuery(SQL_QUERY);
for(Iterator it=query.iterate();it.hasNext();){
Procedure procedure=(Procedure)it.next();

System.out.println("Id:"+procedure.getId());
System.out.println("Name:"+procedure.getUsername());
System.out.println("CLass:"+procedure.getRoom());
System.out.println("Address:"+procedure.getAddress());
System.out.println("Father name:"+procedure.getFaname());

}
session.close();
}
catch (Exception e) {
System.out.println(e.getMessage());
}
finally {
}
}

}
-----------------------------------


April 29, 2008 at 7:36 PM



<class name="roseindia.Procedure" table="proced">
<id name="id" type="int" column="id" >
<generator class="assigned"/>
</id>

<property name="username">
<column name="username" />
</property>
<property name="room">
<column name="room"/>
</property>
<property name="address">
<column name="address"/>
</property>
<property name="faname">
<column name="faname"/>
</property>

</class>
------------------------------

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">;

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/register</property>;
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>
</session-factory>


</hibernate-configuration>


---------------------------------------

read for more information,

http://www.roseindia.net/hibernate/



Related Tutorials/Questions & Answers:
org.hibernate.InvalidMappingException: Could not parse mapping document - Hibernate
. Exception occur:Could not parse mapping document from resource event... by: org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping...org.hibernate.InvalidMappingException: Could not parse mapping document 
DOM Parser Example to Parse A DOM Document
DOM Parser Example to Parse A DOM Document In this tutorial, we will discuss about how to parse(retrieve data) DOM Document. The XML DOM views an XML document as a tree-structure. In this program, we read the XML file and print
Advertisements
how to parse xml document which contains elements with namespace using JDOM - XML
how to parse xml document which contains elements with namespace using JDOM  Hello, I am parsing XML file ,which has structure like... is inside so how can i parse this xml using JDOM,java. Thanks Shree  Hi
Use of <x:parse> tag of JSTL
:parse> tag of  Xml tag library of Jstl. This tag is used to parse the specified xml document. Standard Syntax : <%@ taglib prefix="x" uri="... some operation on the parsed xml document provided by jstl. scope
parse xml
parse xml   <STATES> <STATE sname="AndhraPradesh" >...; </STATE> How to parse the above xml. please help me   Here... docBuilder = docFactory.newDocumentBuilder(); Document doc = docBuilder.parse("c
parse in iphone
parse in iphone  <p>{ itemCount: 2, subtotal: "$15.50", items:[ { title: "The Big Book of Foo", description: "Bestselling book of Foo by A.N. Other", imageUrl: "/images/books/12345.gif
servlet mapping
servlet mapping  Defined servlet mapping in web.xml ?   <servlet> <servlet-name>Hello</servlet-name> <servlet...;/HelloWorld</url-pattern> </servlet-mapping> Given above servlet mapping
mapping - XML
mapping  how does the web.xml works and how does the mapping done will you explain me?  Hi Friend, The web.xml file provides... can perform the servlet-mapping like the following: HelloServlet
parse map in java
parse map in java  What is a Parser? Can you give the source code to parse map in Java
parse url iphone sdk
parse url iphone sdk  How can i parse two different URL's using NSXMLParser
php parse string for url
php parse string for url  Do i need a regex to parse a URL-type string in PHP
php parse ini string
php parse ini string  Need to know how to parse the ini file to extract values
php parse string to time
php parse string to time  I am looking for a solution to parse a string into a formatted date time string
php parse string into array
php parse string into array  How can i parse a string into array and convert an array into string
Mapping Application
Mapping Application The mapping is done within an action file called..., their corresponding action class and results returned from the Action class. Before mapping... can also specify the name of the method of an action class in mapping as <
php parse ini array
php parse ini array  I wanted to parse a variable inside a variable value. Can any one give the example
xml document parsing
xml document parsing   Hi Guys, Xml document has been inserted into the database,how do i parse the xml document stored in database,so that xml document can be retrieved on to JSP file using jdbc/odbc connection. Please help me
Hibernate Mapping
In this tutorial we will discuss Hibernate mapping
php parse string to float
php parse string to float  Is there any Regex or way to get float from a string
php parse soap response
php parse soap response  What is soap and how can i convert a soap response to XML. Thanks in Advance
php parse ini file
php parse ini file  I need a simple and easy example to Parsing an ?advanced? INI file with PHP
php parse string as php
php parse string as php  Best way of parsing a string within a string
Could not parse configuration: hibernate.cfg.xml
Could not parse configuration: hibernate.cfg.xml  Hi, I am getting the error- log4j:WARN No appenders could be found for logger.... Exception in thread "main" org.hibernate.HibernateException: Could not parse
include' a HTML document in another document.
include' a HTML document in another document.  I'm trying to `include' a HTML document in another document...Is there a way to do
php parse subdomain
php parse subdomain  Basically, looking for a example on how to let PHP to create subdomain automatically for each user? Is it possible to retrieve subdomain as a get variable
php parse string to date
php parse string to date  In my app i have a date string in the following format: $date = "08/20/2009"; Can you suggest how can i separate each part of the date
php parse string as int
php parse string as int  While trying to pass string to int using int() i get the following error: Call to undefined function int() Why it is throwing an error
the Action Mapping specified
the Action Mapping specified  How is the Action Mapping specified
ActionMapping and is the Action Mapping specified
ActionMapping and is the Action Mapping specified  What is ActionMapping and is the Action Mapping specified
date_parse
date_parse() in PHP date_parse function returns associative array... error. Description on Date Parse Format in PHP array date_parse ( string $date ) Parameters of date parse class PHP date - Date in format accepted
Hibernate Mapping
In this section, you will learn about Hibernate Mapping
Advertisements
 

 

 

DMCA.com