Link Details

Link 21765 thumbnail
User 221988 avatar

By krishnas
via arsenalist.com
Published: May 13 2007 / 18:02

One of the somewhat unclear aspects of the Java Persistence API is exactly how Java entities are populated from database tables. Those of you familiar with Hibernate probably know that you require a setter method in your Java POJO which corresponds to the column that you want mapped. JPA lifts that requirement and instead gives the option of not specifying any accessor methods in favor of reflection. Whether this is good or bad is for your application to decide.
  • 12
  • 2
  • 1563
  • 263

Comments

Add your comment
User 226091 avatar

ggeremy replied ago:

0 votes Vote down Vote up Reply

Nice. It clears up the confusion. Annotating fields is neater but it does come at a performance hit.

User 193095 avatar

pansapien replied ago:

0 votes Vote down Vote up Reply

This article needs to expand beyond that which is in the spec. It should provide insight into non-obvious issues that can arise with either approach. Further it should also quantify performance differences between the different approaches across a few standard implementations.

As it currently stands, this article isn't worth the time it took to read.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (12)



Voters Against This Link (2)