on 11-03-2008 6:06 PM
Hi,
I've an annoying problem:
I have 2 Tables - one with users and one with categories. There is a relation between this tables, that every user can have one category and a category can have n users (n:1).
When I delete a category, I also have to remove the category from the users table, but I dont want to delete the whole user - only his category. The dictionary field is not NOT NULL, so that I can delete the category of the user with sql-statement (update-statement).
Now the problem: I dont want to use sql-statements for many reasons. So I will do it within the bean, but when i execute
userLocal.setCmrField_relationUserCategory(null);
nothing happens. no results in database and no exception.
Does someone know this problem and may help me.
One additional question is, why can I remove a category that users have in their profile?
I thought this would not be possible due to the relation, but it happens, without an error :?
Thanks and Regards Norman
Edited by: Norman Nuernberger on Nov 3, 2008 7:08 PM
Hi,
What version os EJB are using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, thats the case. And it works fine with
userLocal.setCmrField_relationUserCategory(categoryLocal);
but when a category have to be deleted, the users with this category should have no category anymore, till they choose a new one and therefor I tryed
userLocal.setCmrField_relationUserCategory(null);
and this doesn't work. Nothing happens, no result and no exception. And I want to know why. Is it wrong? How can I delete only one attribute like this:
update USERTABLE set CATEGORY = null where CATEGORY = '<deletedCategory>'
but without sql-statements?
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.