File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes what sould be generator element & where to put save method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "what sould be generator element & where to put save method" Watch "what sould be generator element & where to put save method" New topic
Author

what sould be generator element & where to put save method

anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
here is my index.jsp


this is my databse class


this is my servlet


now this is working
But i need to add to this hibernate
so i did this
this is my hibernate.config file


1)my question is there is no long type colum in my table.So what should be generator element in hbm file
i ad this


2)Other question is wheer to put SessionFactory and save methods.in servlet or pojo class.Because my incdex jsp goes to WelcomeProcessor servlet
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

1 - if your primary key is name then you've got the mapping right. There is a lot to be said (and has already been said if you search this forum) about using a surrogate key though.

2 - Your SessionFactory and Session methods would go in you data access layer.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
Your SessionFactory and Session methods would go in you data access layer.
can you explaing about this?
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
i change my class
here is index.jsp


this is welcomeprocessor


this is hibsernatecllass


this is student bean clas


but when i am going to run index.jsp
here is error


this is consol error


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what sould be generator element & where to put save method
 
Similar Threads
Error in Accessing
change to soap request
is there a any validation API in java
java.lang.NoClassDefFoundError
Verification failed on Username existence check using AJAX