Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML
 
 
Hot Web Programming Job

 

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials

Core Java
JSP
Servlet
JDBC
Hibernate
Struts 1
Struts 2
JSF
Spring
J2EE
J2ME
Web Services
Ajax
Dojo
MySQL
Latest Comments
thanks for your he
Eclipse ME
code
Developing Methodo
Sam Rabophala
  All Comments...
 

 

 
Struts Tutorials
*Stuts TOC
*Apache Struts Introduction
* Struts Controller
* Struts Action Class
* Struts ActionFrom Class
* Using Struts HTML Tags
*Struts Validator Framework    
*Client Side Address Validation    
*Struts Tiles
*tiles-defs.xml
*Struts DynaActionForm
*Struts File Upload
*Struts DataSource
*AGGREGATING ACTIONS
*Internationalization
Struts Resources
*Struts Books
*Struts Articles
*Struts Frameworks
*Struts IDE
*Struts Alternative
*Struts Links
*Struts Presentations
*Struts Projects
*Struts Software
*Struts Reference
*Struts Resources
*Other Struts Tutorial
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Hibernate Hibernateormapping

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

47 comments so far (post your own) View All Comments Latest 10 Comments:

hi,
i dint get solution for one to many still.
I tried out the above given code too.
can u give me the proper steps or site for proper
tutorial to be followed?

Posted by shanmuganathan on Monday, 10.13.08 @ 10:01am | #81036

hi team,
we did one to one hibernate mapping.
we are trying one to many mapping.But its difficult for us. Can u help us? And can anyone provide good tutorial for solving this??Thanks in advance

Posted by shanmuganathan on Wednesday, 10.8.08 @ 12:48pm | #80960

SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();
//Create new instance of Contact and set

System.out.println("Inserting Record");
Contact contact = new Contact();
//contact.setId(1);
contact.setFirstName("Nitin");
contact.setLastName("Kumar");
contact.setEmail("nitin_38@yahoo.com");
Transaction tx = session.beginTransaction();
session.save(contact);
tx.commit();
System.out.println("Done");

Posted by Nitin Gupta on Tuesday, 09.30.08 @ 11:40am | #80793

Hi
Basically i am newly reader for Hibernate.How can run a simple Hibernate Web Application on NetBean5.5 IDE.How i use Jdbc with Hibernate.

sanjeev

Posted by Sanjeev on Thursday, 09.11.08 @ 14:27pm | #78666

Very easy to understand for the beginners but, I request the roseindia team to publish it with out any errors and list out the jars and their usage in the application.

Posted by LaxmiKanth on Tuesday, 09.9.08 @ 12:54pm | #78224

It's the same question that someone has asked before but I don't see the answer being posted. I tried the example code, the schema gets created, but data is never inserted into the table Contact.

What to look and how to get it working?

Thanks.

Posted by Smitha on Wednesday, 08.27.08 @ 00:49am | #75347

Thanks,

This is a very easy and good example for Hibernate beginers.

Posted by Hemant Chitte on Monday, 06.2.08 @ 17:49pm | #61827


Can u please send me some document of hibernate.

Posted by swadhin on Saturday, 04.26.08 @ 15:08pm | #57927

Hi,

your explanation and example is too easy and too great for a newly reader.

Posted by swadhin on Saturday, 04.26.08 @ 15:06pm | #57926


problem parsing :configuration/hibernate.cfg.xml

ANy onr can tell me why this error id appera when i m rum my application

Posted by Amit Gupta on Wednesday, 12.12.07 @ 11:55am | #41915


problem parsing :configuration/hibernate.cfg.xml

ANy onr can tell me why this error id appera when i m rum my application

Posted by Amit Gupta on Wednesday, 12.12.07 @ 11:54am | #41914

Hi
when i run the firstexample.java .it is showing in the console that row inserted .buty when i check in teh db throgh query i am not getting any row in the table .

please tell me where i may have to look into,

Posted by khirod on Friday, 11.16.07 @ 16:30pm | #37563

It is really a nice tutorial for new bie

Posted by sunay on Thursday, 11.15.07 @ 11:04am | #37477

check the xml files. change the database name and create the tables.//

Posted by rajesh on Monday, 11.12.07 @ 19:37pm | #36982

To Deepa,

You have to get a mysql-connector-java-5.0.7.zip file for the driver. Unzip it and give the classpath. Then only u can use the com.mysql.jdbc.Driver

Posted by Krishna Kumar on Wednesday, 09.26.07 @ 15:32pm | #29646

iam getting the following error can anybody help me out




log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:262)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:184)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1497)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1041)
at FirstExample.main(FirstExample.java:22)

Posted by Niranjan on Friday, 07.20.07 @ 13:15pm | #21623

Hi Here is dll you can use for createing table.

create table hibernatetutorial.`contact` (`id` int not null, `firstname` varchar(50), `lastname` varchar(50), `email` varchar(50), constraint hibernatetutorial.`PRIMARY` primary key (`id`));

And also you can get rid of error syaing
JDBC Driver class not found
by just adding appropriate .jar file of related database.

Posted by Jigar Patel on Monday, 07.2.07 @ 22:55pm | #20616

We require an example program to build with the WSAD tool

Posted by NagaSrinivasRayana on Monday, 06.11.07 @ 11:25am | #18890

The best for beginners to understand teh clear picture of hibernate.
Thx roseindia

Posted by Venu on Wednesday, 04.25.07 @ 20:16pm | #14923

Thanks RoseIndia Author
This was really a great tutorial
i got pretty good kowledge about hibernate by reading and folowing these examples

Posted by Arun on Thursday, 04.12.07 @ 17:26pm | #13965

It's really a good tutorial for the beginners who wanted to learn the basics of hybernate and understand the architecture

Posted by Irfan Khan on Friday, 04.6.07 @ 20:34pm | #13482

can u help me how to run hibernate with oracle 10i,here is the config file,it says
JDBC Driver class not found: oracle.jdbc.driver.OracleDriver
<?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">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:ORCL</property>
<property name="hibernate.connection.username">ipdc</property>
<property name="hibernate.connection.password">Pro4WoAf</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Posted by manogna on Friday, 04.6.07 @ 11:49am | #13454

while running the pgm iam getting an error- class not found...com.mysql.jdbc.driver...i have added all jar file for the connections to mysql...plz help me...

Posted by deepa on Wednesday, 04.4.07 @ 10:16am | #13313

Thumps up for the Author. Excellent tutorial for the beginners. Still some more in-depth examples are required. Good Job roseindia....

Satya

Posted by Satya on Tuesday, 04.3.07 @ 18:39pm | #13279

hey its really useful tutorial for understanding basic architecture about hibernate.
But need some more in depth.

Posted by ria on Tuesday, 03.6.07 @ 08:37am | #10794

Is it possible to use hibernate with MsAccess, what's the dialect for Access

Posted by Rajesh.CH on Monday, 03.5.07 @ 20:17pm | #10748

While running the hibernate application i m getting these errors please help me...

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
/hibernate.cfg.xml not foundException in thread "main" java.lang.NullPointerException
at Site.FirstExample.main(FirstExample.java:44)

Posted by sanjay kumar on Friday, 03.2.07 @ 12:15pm | #10191

Can any one tell me how to run hibernate in WSAD. when i try to run the example given here it shows an unsupported class version error.

Posted by prasanna on Thursday, 02.15.07 @ 12:27pm | #7950

It's very nice and helpful tutorial for me.

I want to know that Can I should use cache class or should go without cache class. Because our project is on JSF,Spring and Hibernate Architecture. And it's contain very large Database. So If I used cache then it's possible to concern on memory area also.
Please guide me.

Posted by pankil on Friday, 02.9.07 @ 18:21pm | #6994

Its really amazing. I was not knowing about hibernate.But now i m feeling better.Its really good for beginners.

Posted by Prabhat Kumar on Friday, 02.9.07 @ 17:04pm | #6981

This is very very good web site for beginners.
Really very good job done by rose india.
Thanks. thanks a ton

Posted by Indira on Wednesday, 02.7.07 @ 11:46am | #6545

This is a really gud tutorial to start learning hibernate.kudos to the author.

Posted by shivanandh on Saturday, 02.3.07 @ 13:44pm | #5664

Hi This is very nice

Posted by kannan on Wednesday, 01.24.07 @ 14:11pm | #4240

It's really very intresting for those who r begineer.Give some more information in depth for xml files.

Again thanks once again

Posted by ravikash gupta on Friday, 01.12.07 @ 18:20pm | #3290

this is a great tutorial

many many thanks

Posted by Niraj on Thursday, 01.11.07 @ 05:48am | #3170

Can you tell us the exact difference b/w Increment and Sequence in the Id generator

Posted by Sri on Friday, 01.5.07 @ 23:02pm | #2730

thanks for your tutorial, is very nice for me
im begginer hibernate user

Posted by roberto on Thursday, 01.4.07 @ 05:32am | #2583

hi this is very nice.but we want more detailed.

Posted by bipbaloon on Tuesday, 01.2.07 @ 15:27pm | #2414

If my table contains primary key that is combination of more then one column in database then what column value will be given in id tag

Posted by Ankit on Friday, 12.29.06 @ 12:58pm | #2204

I have run FirstExample.java and getting inserting records done.
But in database there is no record. How is this happens???

Posted by Ankit on Friday, 12.29.06 @ 12:56pm | #2203

Rally Helpful for Brginers...
Thanks to Roseindia

Posted by Phani on Thursday, 12.21.06 @ 16:44pm | #1396

Hello there,
I found this tutorial very interesting.
And its easy to learn.
But a bit more depth in concept is required.

Thanks for the tutorial.

Posted by Monalisa on Tuesday, 12.19.06 @ 18:15pm | #1263

Really amazing stuff from the roseindia.
keep it up guys.

Posted by rakesh on Tuesday, 12.19.06 @ 17:56pm | #1261

It is very help full for the beginners.
And give some more infomation( in depth).

Posted by pradeep kumar simhadri on Monday, 12.11.06 @ 15:20pm | #842

This is great and an easy way to explore hybernate ,thanks to rosenet india

Posted by Praneeth on Monday, 12.11.06 @ 12:17pm | #753

Really very helpful for the beginners.

Thanks for the Tutorial

Posted by meyyappan on Tuesday, 12.5.06 @ 15:15pm | #414

Hi
really it is very useful for those who just want to learn in their very first attempt

Once thanks for this publication

Posted by udhayakumar on Friday, 11.24.06 @ 19:15pm | #96

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Back to Tutorial

 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.