| Stefan Siegl 2004-03-19, 8:45 pm |
| Hello group,
I was wondering which and how EJB entity beans support integrity
constraints. I can think of a few answer but i am not sure, so any help
is appreciated.
domain constraints:
imo domain constraints can be modelled using BMP (just some kind of
tests if the value to store is within the accepted domain values).
With CMP i am not sure. i did not find any information about that so i
think that domain constraints are not supported by CMP?
key constraints:
possible with BMP, not supported by CMP for alternate keys
primary key constraint (no part of the PK may be null):
possible with BMP, possible with CMP, because the PK is a class that is
created by a constructor in which the developer can check for null values
semantic (enterprise) constraints:
I refer to constraints such as "salary should never exceed 200.000"
Possible with BMP, not possible with CMP
referential integrity:
refering to books it is automatically enforced by CMP and also possible
with BMP. What i was wondering is what kind of option does CMP choose
(cascade/nullify/reject/do nothing). In other words what is the default
action? I suspect that the default action is "do nothing", because there
is the possibility inside the deployment descriptor to use cascading
deletes (<cascade-delete> ).
Am i right? Thanks for any help
Best regards,
Stefan
|