[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2212) framework objects do not work with entities mapped in *.hbm.xml
daniel varga (JIRA)
jira-events at lists.jboss.org
Mon Nov 5 09:45:45 EST 2007
framework objects do not work with entities mapped in *.hbm.xml
---------------------------------------------------------------
Key: JBSEAM-2212
URL: http://jira.jboss.com/jira/browse/JBSEAM-2212
Project: JBoss Seam
Issue Type: Bug
Components: Framework
Affects Versions: 2.0.0.CR3
Reporter: daniel varga
I develop a web app which has it model classes in a separate jar that also contains the hbm.xml files for mapping the entities. The entities are accessed through standard JPA EntityManager. There are both query and home components declared in components.xml:
<framework:entity-query name="subsystemList" ejbql="select s from CaasSubsystem s" max-results="1000" />
<framework:entity-home name="subsystemHome" entity-class="com.comptel.cs.caas.pojo.CaasSubsystem" />
Everything goes fine until I delete an entity with the home component. Then Seam.getEntityClass gets invoked and returns null, which in turn causes the following:
Caused by: java.lang.IllegalArgumentException: Not an entity class: com.comptel.cs.caas.pojo.CaasSubsystem
at org.jboss.seam.Entity.forClass(Entity.java:208)
at org.jboss.seam.persistence.PersistenceProvider.getName(PersistenceProvider.java:75)
at org.jboss.seam.persistence.HibernatePersistenceProvider.getName(HibernatePersistenceProvider.java:246)
at org.jboss.seam.framework.EntityHome.getEntityName(EntityHome.java:123)
at org.jboss.seam.framework.Home.getSimpleEntityName(Home.java:255)
at org.jboss.seam.framework.Home.raiseAfterTransactionSuccessEvent(Home.java:250)
at org.jboss.seam.framework.EntityHome.remove(EntityHome.java:64)
This is because the Seam.getEntityClass checks for @javax.persisence.Entity annotation or ejb3 xml mapping, but it does not take into account that entities can mapped by hbm.xml files too.
I tried using hibernate-entity-home and hibernate-entity-query components , but it did not help and the exception occurred more often, not only after invoking remove on the entity home component.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list