Dears,
I'm having some problems in identifying the best approach to follow in order to create a .par archive with entitites and related "home" objects.
I was trying to follow the same pattern that the Hibernate Tools adopt when reverse-engineering a db structure using EJB3 annotations:
Code:
@Entity
@Table(...)
public class MyEntity implements Serializable {
...
}
@Stateless
public class MyEntityHome {
...
}
At deploy time, Entities are correctly detected and tables build (using the well-known "create-drop" hbm2ddl setting), but the "Homes" yield a "java.lang.ClassCastException: org.jboss.ejb3.stateless.StatelessContainer" and are not deployed.
Also, the ejb3 specs seems not specify anything about how to implement home methods in entities.
Please also note that I get the very same error when describing my entities through .hbm.xml file(s).
Is there any pattern to follow for home methods in entities? At least in the jboss 4.0.3SP1 I'm using.
Regards,