I am using JPA 2.1 in Netbeans to create my entity. If my database has no table then it should create table from entities.
When I deploy and run my enterprise applicati
Just in case someone is interested: It seems that since JPA 2.1 / Glassfish 4.1 you need to use your PU somewhere before the tables are created. These two lines should be enough, i.e. in an EJB:
@PersistenceContext
private EntityManager em;
or
@PersistenceContext(unitName = "CommonInfrastructure-ejbPU")
private EntityManager em;
See also my answer here: How to use JPA with Java EE 7, Glassfish 4.1 and Maven on JavaDB