I have project in PLAY FRAMEWORK wich contain few submodules.
Each submodule has folder structure like this:
I figure it out on my own.
Runtime error:
[IllegalArgumentException: Unknown entity: models.common.AppMode] Is caused by Jpa/Hibernate configuration. Problem is that Jpa/Hibernate sees my entities (mark by annotation @Entity) while compilation, but in runtime dosn't. To fix that I've to manually point all my models class (entitites) in persistance.xml file as follow:
/conf/META-INF/persistence.xml
org.hibernate.ejb.HibernatePersistence
DefaultDS
models.common.AppMode
models.Customer
models.Complaint
Original post: package names (namespaces) in subproject classes in Play Framework
I wonder why in main project (f.e: /app/models/User.java
) I can use annotation @javax.persistence.Entity
(and it works), but in sub project (f.e: /modules/common/app/models/AppMode.java
) it dosnt work, the annotation @javax.persistence.Entity
is not enought, I have to point each model class in persistance.xml file.
I think it is a bug in playframework (I've checked 2.2.1, 2.2.4, and 2.3.4 versions)