The issue you're encountering is likely due to the primary key constraint on the Roles entity. In your Roles entity, the userId field is defined as the primary key, this means that each userId can only have one entry in the roles table, which is why only one role is being inserted. To allow multiple roles for a single user, you need to define a composite primary key that includes both the userId and another field.