Searching

Searching

View Answers

May 2, 2008 at 7:03 PM

Hi friend,

package roseindia;

import org.hibernate.*;
import org.hibernate.criterion.*;
import org.hibernate.cfg.*;
import java.util.*;
import java.util.Iterator;

public class SearchRecordHibernate{
public static void main(String[] arg){
Session session = null;
try{
SessionFactory sessionFactory = new Configuration().configure()
.buildSessionFactory();
session = sessionFactory.openSession();

String SQL_QUERY = "from RecordInformation as record where record.userid LIKE 'Sandeep' order by record.userid";
Query query = session.createQuery(SQL_QUERY);
for(Iterator it = query.iterate();it.hasNext();){
RecordInformation inform = (RecordInformation) it.next();
System.out.println("Name:"+inform.getUserid());
System.out.println("Last Name:"+inform.getLastname());
System.out.println("Last Name:"+inform.getQualification());

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

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

package roseindia;

public class RecordInformation {
private String userid;
private String lastname;
private String qualification;
private String engineer;
private String docter;
private int id;

public String getUserid(){
return userid;
}
public void setUserid(String userid){
this.userid = userid;
}

public String getLastname(){
return lastname;
}
public void setLastname(String lastname){
this.lastname = lastname;
}
public String getQualification(){
return qualification;
}
public void setQualification(String qualification){
this.qualification = qualification;
}

public String getEngineer(){
return engineer;
}
public void setEngineer(String engineer){
this.engineer = engineer;
}

public String getDocter(){
return docter;
}
public void setDocter(String docter){
this.docter = docter;
}

public int getId(){
return id;
}
public void setId(int id){
this.id = id;
}

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

May 2, 2008 at 7:07 PM

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

<property name="userid">
<column name="userid"/>
</property>
<property name="lastname">
<column name="lastname"/>
</property>
<property name="qualification">
<column name="qualification"/>
</property>
<property name="engineer">
<column name="engineer"/>
</property>
<property name="docter">
<column name="docter"/>
</property>
</class>


May 3, 2008 at 7:19 PM

read for more information

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









Related Tutorials/Questions & Answers:
searching books
searching books  how to write a code for searching books in a library through jsp
searching technique
searching technique  Hi, i need any searching technique in java to search the data and give the all possible data by links
Advertisements
searching problem
searching problem  how we can make a code in core java for searching in hard disk? i have to make an antivirus as my minor project , so i have need this type code to search the virus in hard disk
searching problem
searching problem  how we can make a code in core java for searching in hard disk? i have to make an antivirus as my minor project , so i have need this type code to search the virus in hard disk
file searching
file searching  i need a prog for searching inside a text file after evry 1 min to find does it hav any new entry
searching string
searching string   how to write a program for searching a string   Hi Friend, Try this: import java.util.*; class SearchString{ public static void main(String[] args){ Scanner input=new Scanner(System.in
searching the data
searching the data  respected sir , i am making the desktop application , so how can i search the data which are stored in the mysql databses through click the button and display in jtable through netbeans dynamically
searching inside a file for details
searching inside a file for details  i created a file with name,country,state etc...when i'm searching for the name, i have to get other details like country,state etc...please do help
searching the string in a paragraph?
searching the string in a paragraph?  how to search a string in a paragraph and display the corresponding line number and position of a string in java
Searching for Code - JSP-Servlet
JSP, Servlet Searching for Code  Hi, i am looking for a jsp servlet code examples for the search function in my application.Thanks
searching from database
searching from database  how to search data from data base throug search...such as contact no./lastname /firstname should give whole information from database...   Please visit the following link: Servlet search
Searching an element - JSP-Servlet
Searching an element  Dear sir, sir i have an employee... in that i am doing a searching an element by empId and displaying a all... field for searching an element by the empId.and one submit button for submitting
Searching an element - JSP-Servlet
Searching an element  Dear sir, sir i have an employee table... doing a searching an element by empId and displaying a all the employee table... for searching an element by the empId.and one submit button for submitting this form.And
Java String searching.
Java String searching.  How to search a string in given String array?   import java.util.Scanner; public class StringSearch { public... and for searching we used userCity.equalsIgnoreCase(city[i
Java Sorting and Searching
Java Sorting and Searching   If anyone could help me with this I would be really thankful! Write a program that stores the names of these artists in a String array. The program should prompt the user to enter the name
Searching English words in a string
Searching English words in a string  My task is to find English words and separate them from a string with concatenated words..for example AhdgdjHOWAREgshshYOUshdhfh I need to find if there exists any English words.   
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project for the Dispatch section of my office. I have to search for letters that are dispatched on a particular date. Now there are thousands of letters dispatched on a particular
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project for the Dispatch section of my office. I have to search for letters that are dispatched on a particular date. Now there are thousands of letters dispatched on a particular
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project for the Dispatch section of my office. I have to search for letters that are dispatched on a particular date. Now there are thousands of letters dispatched on a particular
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project for the Dispatch section of my office. I have to search for letters that are dispatched on a particular date. Now there are thousands of letters dispatched on a particular
searching for strings in a file
searching for strings in a file  how can i search of a person and display the other details associated with the name using java gui window?   import java.util.ArrayList; import javax.swing.*; import java.awt.event.
Finding searching phrase of a search engine
Finding searching phrase of a search engine  how to find out searching phrase of a search engine..? like, if visitors enter the keyword to google, is is any possible to get that keyword
Searching with alphabetical order - Java Beginners
Searching with alphabetical order  Hi, I want to this please help me Steps:- 1:-I have a one form of name text box with two button. 2:-user input in name text box(alphabetical order)search all fields from
Searching with alphabetical order - Java Beginners
Searching with alphabetical order  Hi, please understood my problem and send write code its very urgent I a write once again. Steps.... 2:-User input in the name text box(searching alphabetical order) name
Searching Mobile developer for image recognition
Searching Mobile developer for image recognition  Hi, I have an idea for an application that requires image recognition. I have decided to use Google platform for image recognition. Our application will provide image to google
Insertion, sorting and searching in array
.style1 { margin-right: 2px; margin-bottom: 0px; } Insertion, sorting and searching in array   ... to perform searching and sorting in array. In the java code given below we have
Searching For Important Issues for Writing Articles
Searching For Important Issues for Writing Articles       People all over the world like to read... for their art of creating key issues out of scrap. Whenever you are searching
Searching - Hibernate
Sorting and Searching
searching a text string in file - Java Beginners
searching a text string in file  code to match a string in a file that is already mentioned in java code.if the string matches any part of a string that whole string is printed
Searching a word file on server in JSP - JSP-Servlet
Searching a word file on server in JSP  Seacrhing a word file on server side using JSP. I am Apache Tomcat Server. Please help me Sir
Java: Searching a string from doc files
Java: Searching a string from doc files   I want to search a string from DOC, DOCX files in java. Can anyone please help me
Searching a tex on a table in java! - Java Beginners
Searching a tex on a table in java!  i have a table which contains several data. using a textfield the item hat i search must be selected and will show with using a scroll bar.... how should i do this.... tnx for the response
SEARCHING THE DATA FROM DATABASE AND DISPLAY THE SEARCHED DATA IN HTML PAGE
SEARCHING THE DATA FROM DATABASE AND DISPLAY THE SEARCHED DATA IN HTML......but it shows some errors. Error is Notice: Undefined variable: searching in C:\xampp...;/p> <input type="hidden" name="searching" value="yes" />
Google says Start Searching India
Searching India campaign, Google wants to convey to people that there are very easy
Searching an Element in the given XML Document
Searching an Element in the given XML Document       In this you will learn to search an element in the specified XML document using DOM APIs defined
Search Preferences Page Plugin
Search Preferences Page Plugin Plugin for searching within the Eclipse... search pages for searching: Preference pages Menu items Views Have... symbols when searching for preferences pages and view icons when searching
SQL % Wildcards
SQL % Wildcards       SQL wildcards used for  searching one or more characters from data in a database.  ADS_TO_REPLACE_1      ADS_TO_REPLACE_2   Create
SQL _ Wildcards
SQL _ Wildcards       SQL wildcards are used for  searching one or more characters from data in a database. The SQL wildcards substitute one or more
Linear Search in Java
Linear Search in Java In this section, we are going to find an element from an array using Linear Searching. Linear searching is a good way to find an element from the array. The array can be of any order, it checks whether a certain
Finding an Element in a Sorted Array
;    In the sorted array, searching is very easy... an searching an elements in the array. This example takes some inputs from the user... of binary search. This way of searching takes more less time than the index search
Mysql Date Wildcard
Mysql Date Wildcard       Wildcard in Mysql is used to search a data in the database. The Wildcard is used to substitute a character while searching a value in the database
jQuery Button
What is JQuery Button ? A button is a user interface that provides the user a simple way to trigger an event, like searching for a query at a search engine etc. Getting Started with jQuery Animated Button: In jQuery we can make buttons
EMF Search Plugin
EMF Search Plugin       This Eclipse 3.0 plugin provides a search page specialized for searching EMF model instance data serialized to workspace resources. Currently supported
iPhone Baby Name App, iPhone Baby Name, Baby Names application for iPhone
application for searching the names for your baby... searching Favorite Add Names Emailing of the names
Learn to Set Up An Internal Private Repository For An Organization
that the developers are not wasting time in searching and downloading the required
Why Use Docker for Development?
LIKE Operator
Java Read File Line By Line, Video Tutorial of Java Read File Line By Line
Vacation Tour in Agra

Ads