Presistace classes in hibernate

Presistace classes in hibernate

Explain the persistence class in hibernate?

View Answers

March 8, 2011 at 3:21 PM

Hi Samar,

Persistence class is a class in our web application. It holds the entities of the business application (Example- Employee id and name etc.). Hibernate works better if these classes follow some rules. It is also known as the Plain Old Java Object (POJO) programming model.

Thanks...


March 8, 2011 at 3:26 PM

Hi Samar,

  Persistence class is a class in our web application. It holds the entities of the business application (Example- Employee id and name etc.). Hibernate works better if these classes follow some rules. It is also known as the Plain Old Java Object (POJO) programming model.

Example of POJO

package net.roseindia.Model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "userinfo")
public class AddInformation implements Serializable {
private int id; 
private String firstname;

@Id
@GeneratedValue
@Column(name = "id")
public int getId() {
    return id;
}

@Column(name = "firstname")
public String getFirstname() {
        return firstname;
    }
public void setId(int id) {
        this.id = id;
    }

public void setFirstname(String firstname) {
        this.firstname = firstname;
    }
}

Thanks....

Ads









Related Tutorials/Questions & Answers:
Presistace classes in hibernate
Presistace classes in hibernate  Explain the persistence class in hibernate
Hibernate Classes
In this section, you will learn about persistent classes in Hibernate
Advertisements
Hibernate create POJO classes
Hibernate create POJO classes In this tutorial you will learn how to create a POJO class in Hibernate. POJO (Plain Old Java Object) is a programming model...) to create a classes that implements the entities of the business problem. These can
Hibernate API
Hibernate API In this section we will learn about important Hibernate API. Hibernate one of the best ORM tool to develop database driven applications in Java. Hibernate provides API to perform CRUD operations on the persistence objects
DAO Classes
DAO Classes  login page code for Dao classes
wrapper classes
wrapper classes  Explain wrapper classes and their use?   Java Wrapper Class Wrapper class is a wrapper around a primitive data type... of the primitive wrapper classes in Java are immutable i.e. once assigned a value
classes
classes
Inner classes
Inner classes   Hi I am bharat . I am student learning java course . I have one question about inner classes . question is how to access the instance method of Non-static classes which is defined in the outer
classes and objects
classes and objects  Define a class named Doctor whose objects... methods, and an equals method as well. Further, define two classes: Patient... classes a reasonable complement of constructors and accessor methods, and an equals
Helper classes in java
Helper classes in java  helper classes
ai classes
ai classes  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: ai classes Try to provide me good examples or tutorials links so that I can learn the topic "ai
ml classes
ml classes  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: ml classes Try to provide me good examples or tutorials links so that I can learn the topic "ml
classes in c++
classes in c++  1- design and implement a class datatype that implement the day of the week in the program.the class datatype should store the day, such as sun for sunday. the programe should be able to perform the following
Classes and Objects
Classes and Objects       Objects and classes are the fundamental parts of object-orientated programming technique. A class... illustrates how to define our own classes, that includes declaring and defining
HIBERNATE
HIBERNATE   What is difference between Jdbc and Hibernate
hibernate
hibernate  what is hibernate listeners
hibernate
hibernate  what is hibernate flow
hibernate
hibernate  please give me the link where i can freely download hibernate software(with dependencies)   Learn hibernate, if you want to learn hibernate, please visit the following link: Hibernate Tutorials
Hibernate
Hibernate  hibernate delete query execution
hibernate
hibernate  what is hibernate why we use
Hibernate
Hibernate  how to use pagination concept in Hibernate
hibernate
hibernate   I want to learn how to use hibernate framework in web application . for storing database in our application
hibernate
hibernate   I want to learn how to use hibernate framework in web application . for storing database in our application
ModuleNotFoundError: No module named 'classes'
ModuleNotFoundError: No module named 'classes'  Hi, My Python... 'classes' How to remove the ModuleNotFoundError: No module named 'classes... to install padas library. You can install classes python with following command
Anonymous Inner Classes - Anonymous Inner Classes tutorial
.style1 { text-align: center; } Anonymous Inner Classes Except the inner class, there are two types of supplementary  inner classes... inner classes. The class declared inside the body of a method without naming
Java list of uninstantiated classes
Java list of uninstantiated classes  Java list of uninstantiated classes
hibernate
why hibernate?  why hibernate?   Hibernate: -Hibernate... library. It solves object-relational impedance mismatch problems. Hibernate makes the application development process easy Hibernate saves the development
hibernate
hibernate  why we should use hibernate projection
Hibernate
Hibernate  Please tell me the difference between hibernate and jdbc
Hibernate
Hibernate  hello, how to run hibernate program in netbeans?please send me step by step instructions to run hibernate in netbeans

Ads