You really don’t want to do be doing this. There is more going on behind the scenes that has been abstracted away by Mendix. Ideally look to build and update the entities in the database using Mendix itself.
In the App Store you can download Community Commons, there is a Java action that is called ‘Random Hash’. That will create a string that you can use.