File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes What is unitName in @PersistenceContext? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Professional Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "What is unitName in @PersistenceContext?" Watch "What is unitName in @PersistenceContext?" New topic
Author

What is unitName in @PersistenceContext?

Debopam Poddar
Ranch Hand

Joined: Jun 21, 2005
Posts: 46

Please explain unitName in @PersistenceContext and what is its significance?

Can I put and String value as a unitName ?
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 912
Hi Debopam


The unit name for your persistence context represents the name for your persistence unit. Take a look in your persistnce.xml.
A persistence unit is a collection of classes around a database. You can have various persincence units according with your needs.


the injection for this will be :


Regards,
Mihai


SCJP, SCJD, SCWCD
 
 
subject: What is unitName in @PersistenceContext?
 
MyEclipse, The Clear Choice