How simple can persistence.xml get? Why do I need it at all?
I have a simple app with a single persistence unit.
I just found by trial and error that I can greatly simplify persistence.xml (in b36).
<?xml version="1.0" encoding="UTF-8"?>
I don't have to give a name to the persistence context. I simply inject with
@PersistenceContext EntityManager em;
But the name attribute is required in persistence-unit. In fact, section 6.2 of the spec states "A persistence unit must have a name." Apparently, the name of length 0 is ok.
The app server has a default data source (jdbc/__default), and mercifully I no longer need to specify it.
Is this extreme simplification going to get me in trouble?
If not, why do I need to bother with persistence.xml at all?