You don’t need to store the id or the name of the user on your entity (you can, but you don’t need to). What you could do is creating an association between your entity and the account entity. Make sure that this association is set when committing the object to the database.
If the objects in your database are associated with the account like this, you can filter in an xpath retrieve, comparing the association to CurrentUser.
Okay so I’ve managed to create an association to the account entity but when I go to inspect it inside of the database viewer there’s nothing there? How am I supposed to filter via xpath if there is no data coming from my association?
Here is a learning path teaching you something about entity access (the right for users to read/write on certain entities). There is also something in it about the association to the current user. It isn't much, but it will maybe help you understand how to use the current user token.
https://gettingstarted.mendixcloud.com/link/module/36/lecture/155