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

x
?
Solved

generator to native

Posted on 2011-03-24
7
Medium Priority
?
306 Views
Last Modified: 2012-05-11
Hi,

I would like to know what is generator setting to native in hibernate. Where and how and why to use it. How to know hibernate picks either identity, sequence or hilo algorithm. Any ideas, resources, links, sample code highly appreciated. thanks in advance.
0
Comment
Question by:gudii9
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 1000 total points
ID: 35212608
0
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 35212611
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35213428
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 20

Assisted Solution

by:Sathish David Kumar N
Sathish David  Kumar N earned 1000 total points
ID: 35213560
native is  used whenever you have your underlying database handling the primary key generation. Hibernate choose itself a best way to generate id according to database it is interacting with

whenever you are confused which generator to choose, give a try with native.

use assigned whenever you have own style of generating ids. Sometimes whenever i've random data in my table and hibernate is unable to identify pattern for generating next id, i use assigned so that i can manually generate my ids and supply it  for persistence.

Remember, if you haven't chosen any generator you have supply it by yourself i.e. assigned is a default generator.
0
 
LVL 7

Author Comment

by:gudii9
ID: 35353673
>>>Remember, if you haven't chosen any generator you have supply it by yourself i.e. assigned is a default generator.

>>>http://www.roseindia.net/hibernate/hibernateidgeneratorelement.shtml

I do not see explanation of assigned. Can we use assigned with oracle. I only see squence with oracle database. what this assigned will do by default and what sequence do. please advise
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35356641
>>>>>>its there

assigned       lets the application to assign an identifier to the object before save() is called. This is the default strategy if no <generator> element is specified.
0
 
LVL 7

Author Comment

by:gudii9
ID: 35462991
any good video tutorials, online trainings on these these intricate concepts. please advise
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

705 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