BMPs are not a feature of EJB3 (see the spec at http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html) You can create only BMPs according to the EJB2.1 spec (which is part of the EJB3 spec and should still be supported in JavaEE5 containers).
That's quite obvious because an Entity bean is now a plain old java object, and it is the job of a Persistence Manager to handle the database access. So the bean is no longer responsible for persisting itself.
Hope this helps
Ouch. That sounds quite unpleasant. So I still have to write reams of XML to specify finders and so on.
Is there any suggested alternative to Entities to hold information that can be looked up via an ID? I can't see an easy way of doing it using sessions and the only way I could see of doing it was entity beans. I was assuming that the final spec would actually fully support Bean Managed Entities or some way of achieving a similar result.
To reply to myself - is the correct way to do BMPs to actually write an EntityManager? Is such a thing possible? That might be quite a nice solution, although a fair amount of work.
yes ....or use an entitymanager (such as Hibernate EntityManager) that allows you to customize almost all parts of the sql used when persisting/querying for objects.
Why is it exactly you still want BMP ?
I want to wrap a complex object around a File - so it isn't database related at all. I could possibly avoid using entities, but it works quite nicely in some ways.
Maybe the right way to do this is just to use a static and something like Stateless Session Beans, but I'm not 100% sure if that is the right approach.