Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Benefits of runtime reflection in Hibernate

 
Sathy thyagaraj
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than utilize byte code processing or code generation, Hibernate uses runtime reflection to determine the persistent properties of a class. what are the benefits of runtime reflection in Hibernate

Sathy
 
madhuchilipi reddy
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it will run time to take the time less and then once we connect with database no need to write to code to connect the database.and also run time it was using connection pooling
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the runtime reflection occurs when you first create your SessionFactory/EntityManagerFactory, and only then. So you create it up front and only once (Singleton).

Byte Code instrumentation works great, but is an extra step before deployment. Not much of an issue.

Mark
 
Sathy thyagaraj
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Mark and madhuchilipi

Sathy
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
runtime reflection is easy. but you can make it access with getters and setters I believe which should be faster.

This is not related to byte code modification which I think happens for other reasons as well.

I do use reflection but I do not use byte code modification.
 
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!