File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes IsEntityRemovalAllowed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "IsEntityRemovalAllowed" Watch "IsEntityRemovalAllowed" New topic


Yaron Rel

Joined: Aug 04, 2009
Posts: 20
I am trying to find a way to know if a removal of an entity is allowed.
is there any simple way to do that?

The method signature:

I have 2 Stateless session bean that I can use each of them:
1. CMT bean with injected entity manager.
2. BMT bean with entity manager that is being created by entity manager factory.

Yaron Rel

Joined: Aug 04, 2009
Posts: 20
I found some ways to know if I am allowed to remove an entity.
The entity removal can be disallowed due to constraints on the DB record that represent the entity to be removed.
I must admit that I don't love this ways because I rely on condition of exceptions, but this is what I got.
Here are 3 ways:
I agree. Here's the link:
subject: IsEntityRemovalAllowed
It's not a secret anymore!