-3

I am creating one actor object and storing that actor object inside databases and what ever object i am creating it is also populated on drop down list , Now my requirement is that I want to delete this actor object but it should delete temporary from database means deletion operation should perform but original object reference should still remain in databases so in future i can retrieve those data, but once You delete the object it should not available in drop-down list .

Finally I want to Tell Can Any One Provide Java Code To Perform Soft-Deletion of Data, so that i can take some help

ashish
  • 11
  • 2
  • 1
    create another field in your database .when you delete set it to false . – Madhawa Priyashantha Jul 14 '15 at 10:37
  • Please read the "how to ask a question" section of the FAQ. In particular, clear, readable questions which show some effort to solve the problem are welcome. – tucuxi Jul 14 '15 at 10:50
  • You can also maintain soft deletion in a separate table and fetch drop-down list data as a result of join on 2 tables. – Rajesh Jul 14 '15 at 10:53

2 Answers2

0

This is not a Java question but just to point you in the right direction, this is more related to your Database design.

The simplest way to do this is to add a new column in your actor table.

Something like actor.is_deleted or actor.is_active.

EDIT: Here is a good SO question about it.

Community
  • 1
  • 1
Rey Libutan
  • 5,226
  • 9
  • 42
  • 73
0

**

You can add the a column in the DB called "IsDeleted" with the type Boolean or char(1). values can be True or false(Y or N). while fetching the data from the database fetch it if it is (Y)false and populate it to the drop down.

**

Aradhya
  • 182
  • 1
  • 6
  • 17