You can get the Mendix id of an object by using CommunityCommons java action ‘GetGUID’. Store this id either in another attribute of the object. This is of course redundant, you can also store it in a non-persistent helper entity. Do this before you call the SQL.
I sore it use non-persistent, but can not saved,I sore it use non-persistent, but can not saved,