mardi 27 septembre 2016

How to configure the association between Log and User table?

I develop a web application in Java by using JSF, Hibernate and Mysql technologies. I process authentication and authorization on the server-side, that's why I create users that have user name&password and saved in User table in DB. If an user can enter right user name and password, it can enter and control the system. Also, every step of user is logged and saved as a row in Log table in DB with related user name.

I mean I create association between Log and User table. I use user name as foreign key in Log table. However, i cannot delete the user if there is even a row in Log table that is related with this user. DB stops this deletion and returns exception. Actually, this is excepted exception because of the association between Log and User table.

How can I solve this problem? How should I configure this process so that logs are gathered based on user behaviour and users can be deleted when demanded?




Aucun commentaire:

Enregistrer un commentaire