How can we add constraints to XPath in Java action?

Hi All, There is a java action named ‘deleteAll’ in community common. this action will delete all the entries in the entity that we supply to the java action. Instead of deleting all I want to add some constraints like ‘created date’ is ten days older than current date or so. But I have no clue how I can do this. the current statement in the java action looks like this: Can anyone guide me how I can add the constraint here? Thanks,
2 answers


If you have a lot of stuff in your database, you can also create a new database via Project Settings | tab Configurations. Then you start with a clean database. At a later moment, you can delete your old one.


Thanks for the clear context. In general I strongly recommend using Mendix so much as possible. If it’s too complex or not possible in Mendix, you can use Java.

In your case you want to delete entities where specific constraints.

  • Retrieve a list from your database and set constraints via XPath
  • Delete the list

Hi Sneha, does this blogpost help you?