Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

primary key in hibernate

Posted on 2008-10-09
2
Medium Priority
?
826 Views
Last Modified: 2013-11-24
how to distinguish primary with other keys in hibernate in java bean class? is id is important? or id stand for primary key?

The id property holds a unique identifier value for a particular event what it means?
0
Comment
Question by:priyapratheep
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Expert Comment

by:darkapple
ID: 22684978
id refers primary key in java bean classes. id is of utmost important because id is the main property which distinguishes one persistent object from another persistent object. id is the representative of a object in a class.

hope this gives you some idea.
0
 
LVL 2

Accepted Solution

by:
themuppeteer earned 1000 total points
ID: 22686755
when you have a database with multiple rows, you need something to make each row unique. That is the primary key (can be one field or multiple together)
When you want to persist your object (=store it in the database) id is what makes your object unique in the
...and in case you use JPA you add @id above the variable or the getter function to show which field you want to use for this.

hope this helps


http://users.telenet.be/free_quiz
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question