• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is unitName in @PersistenceContext?

 
Debopam Poddar
Ranch Hand
Posts: 51
Eclipse IDE Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain unitName in @PersistenceContext and what is its significance?

Can I put and String value as a unitName ?
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic