This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Why hibernate allows entity name to be retrieved only for persistent entities Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Why hibernate allows entity name to be retrieved only for persistent entities" Watch "Why hibernate allows entity name to be retrieved only for persistent entities" New topic
Author

Why hibernate allows entity name to be retrieved only for persistent entities

Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 208

Hello , have a query regarding SessionImpl.getEntityName(EntityObject) , why does hibernate allows to retrieve entity name only for persistent entities and why not for transient
entities ? when i try to invoke getEntityName(object) before invoking persist() it throws TransientObjectException. Any logical reason for doing this ?

Regards,
Shroff.


OCJP-90%,OCPWCD-95%
 
Consider Paul's rocket mass heater.
 
subject: Why hibernate allows entity name to be retrieved only for persistent entities
 
Similar Threads
Why we need to persistent unit in EJB 3.0 ?
Hibernate load vs get, confused on Hibernate Proxies too
Question on find() and getReference()
"Persisting" an entity bean in memory (via BMP)
Difference between detached entity and new entity JPA