This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Table without Primary key

 
Suresh Pritmani
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have few history talbes in Which I am just storing the records.
My requirement is to insert the records only. I dont want to fetch the records.
Is there any performance issue with Hibernate Entity if I am not going to specify Primary key or any surrogate key or any unique key for that table..?
Please help me out.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Suresh..

I think the records in History table, in a time would be fetched again, if we need the history of our data..

Is there any performance issue with Hibernate Entity if I am not going to specify Primary key or any surrogate key or any unique key for that table..?


I think its better to use Primary key, we've to use it although we use only auto increment..
for the History table, Hibernate provide the Immutable Entity to increase the performance..
the one of that term is we don't have to provide getter and setter to make Immutable Entity, we could use constructor..

Hope this helps..
please correct me if i'm wrong...

Thanks..
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is there any performance issue with Hibernate Entity if I am not going to specify Primary key or any surrogate key or any unique key for that table..?

Hibernate will not work properly without a primary key. There is no real performance gain or lose using one, just loss of functionality.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!